593 private links
Note to self: please come back to this post with links on R, its packages and related resources.
Grammar of graphics
- https://github.com/tidyverse/ggplot2
- https://exts.ggplot2.tidyverse.org/gallery community-maintained list of extensions
Integration with reference manager Zotero
- https://github.com/oeysan/c2z (manipulate your Zotero collections, items from R; can be integrated with other tools such as cronR, mailR, or even HomeAssistant)
PDF tools
- https://ropensci.org/blog/2016/03/01/pdftools-and-jeroen (pdftools - A fast and portable PDF extractor)
Integration with GPG
- https://ropensci.org/technotes/2016/10/19/gpg-release (Encryption and Digital Signatures in R using GPG)
Web scraping
- https://blog.rsquaredacademy.com/web-scraping Introduction to web scraping with
rvest
, 2019 - https://www.brodrigues.co/blog/2018-11-01-nethack Scraping with
rvest
and building a data package, 2018 - My own package periodicdata uses
rvest
to create a data package
Email from R
- https://github.com/rstudio/blastula send great-looking HTML email messages from R
- https://github.com/datawookie/emayili send email messages from R
- https://github.com/rpremraj/mailR utility to send emails from R
Integration with MS Office (yes, yes, I know...)
- https://ardata-fr.github.io/officeverse
- https://github.com/davidgohel/officer
- https://github.com/davidgohel/flextable
Interfacing with Google Docs
Resources
- https://emilyriederer.netlify.app/post/team-of-packages (post of Emily Riederer's rstudio::global 2020 talk)
- https://indrajeetpatil.github.io/awesome-r-pkgtools Awesome R Package Development Tools, compiled by Indrajeet Patil, 2024
- https://win-vector.com/2017/02/05/evolving-r-tools-and-practices John Mount, 2017
- https://github.com/nanxstats/awesome-shiny-extensions
- https://zenodo.org/record/7023492#.YwnwHuxBxhH R from Zero to Hero, slides from talk by Batool Almarzouq (in Arabic)
Tools to consider
- https://alexioannides.com/2016/11/02/asynchronous-and-distributed-programming-in-r-with-the-future-package (the
futures
package: distributed computation, non-blocking async input/output, and more) - https://cran.r-project.org/web/packages/geomtextpath/vignettes/geomtextpath.html
Is there a website or R function that can help us answer the question "has this particular person authored any CRAN packages"? Turns out, no.
This question was asked a decade ago on StackOverflow, and for a while the p_search_any()
function of the pacman
package seems to have done the job. But since at least 2018 this function no longer works (likely because CRAN changed its website HTML).
It is unfortunate that the pacman documentation still describes this function, which I imagine might confuse any would-be users.
CRAN does list all package maintainers in a simple (but quite large) HTML table, but that is not the same as authors.
The more modern pkgsearch
package does not offer any way to search by authors, as far as I can tell.
I am not sure whether other repositories (TeXLive, for example) offer a simple way to search by authors. But as demonstrated by pacman
this is doable via web scraping, but as scraping is inherently fragile ideally CRAN should offer the data in some structured format (JSON, XML, whatever). If we are wishing for stuff anyway, I would also like to add that it would be awesome to search not just using name but also ORCID.
When writing in R Markdown format I often would like to comment out one or more lines of text (for example to quickly test variations on sentences or paragraphs) in a way that these comments do not show in the generated HTML file.
The R Markdown Cookbook only mentions HTML comment syntax <!-- your comment -->
which does not stop the comment from remaining in the generated HTML file.
Best solutions, as far as I know:
Additional YAML blocks
Add a YAML block with commented out lines (baptiste's suggestion):
Some text in the document.
---
# commented out text
# and such
---
This works fine, it is just slightly verbose to use.
But it is the only option that works without any issues.
Abuse the markdown link labels syntax
This is the most popular answer (by far) on SO:
Some text in the document.
[//]: # (commented out text)
[//]: # (another comment)
According to other answers/comments, this sort of comment line should always have a blank line before it to be proper.
The drawback for Rmd appears as soon as we have more than one such comment line; knitr spits out a very visible warning in the standard output:
[WARNING] Duplicate link reference '[//]' at ... line ...
.
The only(?) way to avoid those warnings is to differentiate the link labels, but that quickly becomes tedious.
Some text in the document.
[//1]: # (commented out text)
[//2]: # (another comment, now without a knitr warning)
If you know of a less verbose method than adding YAML blocks, or an easier way to circumvent the knitr warnings, I would love to learn about it.
The SI system
- A comprehensive (SI) units package for LaTeX, by Joseph Wright. I cannot recommend this package enough for all scientific or technical documents. CTAN.
Code examples
- Semiconductor pn-junction diagram in TikZ, by Erwann Fourmond (2016)
- Schematic TEM in TikZ, by Eric Jensen (2012)
- Oxidation of iron surface under a blob of water in TikZ, by Jason Waskiewicz (2010)
- Designing a business card in LaTeX, by Olivier Peters. Github repo.
Templates
- LaTeX packages for CVs, resumés
- PhD thesis template for Cambridge university Engineering dept. Supports LaTeX, XeLaTeX and LuaLaTeX.
Integration with R
The ability to integrate any kind of R output into our LaTeX document is very useful, and the technology has reached a high degree of sophistication with knitr and tikzDevice (on the R side) and TikZ/PGF (on the LaTeX side).
- TikZDevice, an R package for producing graphics output as PGF/TikZ code for use in TeX documents. In other words, we start in R, generate an image, and export it to a TikZ picture. tikzDevice was developed around 2009 (here's an early demo) in concert with pgfSweave (this was before knitr entered the scene).
- dvir, offers the inverse approach to tikzDevice: we start in R, generate a TikZ picture, convert that to DVI, then import (and integrate) the result back into R. dvir is less popular than tikzDevice, and is currently not listed on CRAN (in fact, it clashes with an existing completely unrelated package named
dvir
), but appears to have solid technical underpinnings, with LuaTeX support and LaTeX math support.
Integration with Inkscape
- SVG2TikZ, formally known as Inkscape2TikZ, is an Inkscape extension for exporting SVG paths as TikZ/PGF code.
Integration with Microsoft PowerPoint
- IguanaTeX is a PowerPoint add-in which allows you to insert LaTeX equations into your PowerPoint presentation.
Integration with git
- gitinfo2-latexmk, small tool that integrates latexmk and gitinfo2.
Integration with Zotero
- Better BibTeX, a Zotero extension that makes Zotero effective for LaTeX users.
Integration with the web
- TeX commands available in MathJax, a comprehensive list of all commands available in MathJax v2.7.1, by Carol Burns and edited by MathJax creator Davide Cervone. MathJax v2.7 is still widely used, but has technically been superseded by v3. MathJax.
- KaTeX, developed by Khan Academy. Known to be faster than MathJax, but supporting a smaller subset of TeX/LaTeX functions. Differences between the projects appear to be shrinking, though.
Cloud-based LaTeX
Other packages
- Beamer, package for producing presentations and slides. Github.
- FiXme, collaborative annotation tool for LaTeX. Github.
Tips and tricks
Markdown
- JupyText: Jupyter notebooks as Markdown documents
- Generate Google Slides from Markdown
- CriticMarkup - plaintext editing markup for humans
R Markdown
- https://github.com/rstudio/rmarkdown
- R Markdown: The Definitive Guide by Yihui Xie, J. J. Allaire and Garrett Grolemund (2020)
- Authoring books and technical documents with R Markdown by Yihui Xie (2021)
- Create blogs and websites with R Markdown
- Writing reproducible geoscience papers using R Markdown, Docker, and Gitlab by Daniel Nüst, Vicky Steeves, Rémi Rampin, Markus Konkol, Edzer Pebesma (2018)
pandoc
- https://pandoc.org/extras.html
- https://github.com/LaurentRDC/pandoc-plot
- A pandoc-based layout workflow for scholarly journals by Piero (2018)
Quarto
Quarto, by RStudio, sorry, Posit, a new scientific and technical publishing system.
Something to consider, especially if you are new to the field and aren't already invested in the earlier systems.
"Econometrics and Free Software" by Bruno Rodrigues.
Ok, so this video is a few years old, but it does not have anywhere near the views it deserves. It's never too late to do reproducible science! (Video 1m 44s)
Reproducible science not only reduce errors, but speeds up the process of re-running your analysis and auto-generate updated documents with the results.
This is a nice quote by Hadley Wickham:
I hope that more people continue to express visualizations in a programming language, rather than a point and click tool. That’s my hope for the next 20 years, that it becomes a given that code is the language of data science and data visualization.
And a nice interview overall.
Too bad it is now mostly obscured behind Medium's paywall.