[R: New Features on mindr] Support LaTeX Equations. Conversion between .R scripts and .Rmd documents
Brief Intro and curriculum
'mindr' is an R package that can convert a markdown file or multiple markdown files, such as steem posts, into one mindmap. mindr can also convert a mindmap into a markdown file, which can be a good start of your post. A brief introduction can be found in one of my previous posts:
The new version 1.1.7 brings more exciting features.
Keep the LaTeX equations when converting markdown files into mindmaps, as a reply to specter119's comment.
I used some regular expressions to extract the LaTeX codes from the markdown files, and changed them into extended mindmap syntax supported by Docear.
Figure 1. A mind map with LaTeX equations converted by mindr from a markdown file
Convert .R scripts into R markdown (.Rmd) or markdown (.md) documents, and vice versa, so that users can convert .R scripts into mind maps by using mindr.
I added two functions to convert the following elements in .R scripts into R markdown documents.
- code (.R) ---> code block (.Rmd, .md)
- comments beginning with
#---> text body (.Rmd, .md)
- comments beginning with markdown headings ---> headings (.Rmd, .md)
Figure 2. Conversion between a .R script and a .Rmd file