What this code does
For use exclusively as part of the Sweave2Rmd conversion project of Bioconductor. This space convert tex file (obtained from converting Rnw into tex), into cleaner Rmd. The obtained file will still required manual cleaning. More specifically:
- Clean the most common R syntaxes (Rfunctions, Rcode, Rmethod, etc..)
- Include YAML header with the title, author name and dates. Extracted from the {title} and {author} tags if they exist
- Clean common tex text formatting tags: textit, textbd, etc.
- Translates document section, subsections, subsubsections
- Cleaner R chunks
- Remove unnecessary lines
Convertion
- R codes: Rclass, Rpackage, Rcode, Rfunction: translated as content
- text style italic and bold translated accordingly
- \Sexpr{xxx} translated as `r xxx`
- The header of the YAML is added. Some times creates a knit error. Remote all white spaces
- title or author names that include line breaks may fail to process. Add them manually
- Convert section, subsection, subsubsection with #, ##, ### respectively
- If a %Vignette header exists in the tex file, it will be included in the YAML header of the Rmd.
How to use it
Accepts only tex files. Convert you Rnw into tex. Attach and upload you tex, right click to download the processed Rmd. It is is not perfect, so some manual labor will still be necessary.
Warnings
Comes with no guarantee whatsoever. Use at your own risk.
R Kamadjeu (CUNY - New York City)