R Markdown: The Definitive Guide
bookdown.org
bookdown.org
It's worth highlighting that R Markdown actually supports a number of languages including Python - for instance see here: https://bookdown.org/yihui/rmarkdown/language-engines.html
For example, I am currently considering using R markdown to author the documentation for one of my Python packages. Currently my documentation is written in markdown, but I keep having to copy and paste calculations and tables into the markdown. When things change, it would be nice to just be able to re-run the R markdown, converting Rmd -> md and thereby interpolating the latest version of all calculations into the final markdown doc.
No affiliation to RStudio, just a happy customer.
Then I was baffled to discover that there wasn’t an equivalent for Python. Jupyter is great, but I really love the simplicity of my text files and I’m surprised that there isn’t a major implementation given how popular both markdown and Python are. I guess notebooks are just too appealing.
I wrote a blog post a few years ago comparing R Markdown/Notebooks to Jupyter Notebooks: https://minimaxir.com/2017/06/r-notebooks/
Anyway, this feeling set me off on an exploration of alternative tools and packages. Instead of rmarkdown I'm now exploring the pander[1] package, which seems to do most of what I'm looking for, perhaps only a little limited in output formats.
Edit: The Pandoc.brew examples might be most interesting from a direct alternative to rmarkdown for document creation context.[2]
Base R is that much of a pain.
Huge props to Hadley Wickham and whoever helps bring programming niceties to R's otherwise mostly non-programmer userbase
I'll probably move to Julia at some point.
https://bookdown.org/yihui/rmarkdown-cookbook/latex-hardcore...
https://bookdown.org/yihui/rmarkdown-cookbook/html-hardcore....
We generally treat “working in RStudio but not elsewhere” as serious bugs, especially in our open source R packages. Not only because we don’t want to artificially limit usage of other interactive environments, but because a lot of what people do with R is run their code in non-interactive settings like CI/CD pipelines or ETL jobs.
(Actually, an R Markdown compilation is a particularly good example of something people often do from Travis or GitHub Actions)
Before anyone asks, I use Org Mode. I just don't feel like pushing that format on my co-workers. If it's for me only, I use Org. If it's for a collaboration or export into a report, it goes into an R Markdown file.
I used markdown + pandoc to write my PhD thesis, but was forced to resort to latex for any formatting that was even slightly complicated (ie, multifigure plots, tables, etc).
An official portable version of R-Studio: one that lives off a folder in the computer, and can be moved to a new PC in a pinch with all settings and plugins intact, and works with all official packages... would be very sweet. (Reason: upgrading from one PC to a newer one is a pain if one has to install application software from scratch. Copying over the "portableApps" folder is so much easier.
Portable R available via PortableApps here: https://portableapps.com/node/32898
Portable RStudio via instructions here: https://rpubs.com/jsmccid/rportable
It's also a bit telling that this "definitive guide" does not include any troubleshooting/debugging sections - the expectation seems to be that it "just works" so long as you use it in RStudio, but otherwise you are on your own.
Not sure that I am aware of many other R packages with this mentality, but I am personally not a fan.
I'm using it occasionally at work as well, but I still prefer R scripts with nice comments for work.
There's a whole bunch of stuff you can do by hand. But if you do it by hand, you'll compromise your sense of satisficing. It amazes me how often the 'work harder' crowd doesn't reconcile the two.
If you can quickly and reliably figure out we're spending $100k a month, you get a raise. If you can figure out why it's $100k instead of $80k, you might be up for a promotion.
Read up the section on parameterized reports and realize you can do the work of dozens .
https://bookdown.org/yihui/rmarkdown/parameterized-reports.h...
rmarkdown is insanely effective at getting information out of your hands and into stakeholders repeatedly and in an visually appealing way. When you combine that with your domain knowledge, your value to your company will increase.
This was the killer (visual) feature in LyX when I used it to author LaTeX documents. Great to hear rmarkdown has similar support.
Background: https://blog.jupyter.org/survey-jupyterlab-and-beyond-88c7fb...
Currently using RStudio to write my masters papers in markdown and convert them to PDF. Love it!
Well, you might be too optimistic about people not commenting on R. Usually I tend to avoid reading HN, but I feel pretty much every single time when someone brings up anything related to R, some people will start mentioning how terrible R is, sooner or later :) Now people also start fighting around Tidyverse, although I have no idea why that's relevant to R Markdown...
https://github.com/melling/ISLR/blob/main/chapter08/08_Lab02...
https://github.com/melling/ISLR/blob/main/chapter08/08_Lab02...
I need to figure out how to better fit images so I don’t have pages with large gaps
Also, you can now embed executable Python in the files.
I don't see the Wolfram products talked about very much here
[0]: https://writings.stephenwolfram.com/2019/02/seeking-the-prod...
For info, Rmd also uses pandoc under the covers. Agree it's the power tool, quite a wonderful thing.