GeistHaus
log in · sign up

Objects that feel mutable in R - R-hub blog

blog.r-hub.io

In R, most often, to change an object, you need to re-assign its new value to it. But sometimes, things feel different because objects are mutable or it seems they are, be it in base R code or in the code of packages. Why and how to provide a mutable API/interface in R code? In this blog post, we shall explore a few odd examples a few examples to better understand mutable APIs in R.

2 pages link to this URL
Cast (R)Markdown Files to XML and Back Again

Parsing (R)Markdown files with numerous regular expressions can be fraught with peril, but it does not have to be this way. Converting (R)Markdown files to XML using the commonmark package allows in-memory editing via of markdown elements via XPath through the extensible R6 class called yarn. These modified XML representations can be written to (R)Markdown documents via an xslt stylesheet which implements an extended version of GitHub-flavoured markdown so that you can tinker to your hearts content.