Description Usage Arguments References Examples
View source: R/rnw2rmd2.R View source: R/rnw2rmd.R
This is a much enhanced R port of Perl code gists from GitHub [1, 2]. It tries its best to convert old Sweave vignettes into R markdown. Please do not expect it to do wonders, but to give you a good starting point for conversions.
This is a much enhanced R port of Perl code gists from GitHub [1, 2]. It tries its best to convert old Sweave vignettes into R markdown. Please do not expect it to do wonders, but to give you a good starting point for conversions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
file |
Path to an *.Rnw file to convert. |
output |
Character string defining the R markdown output format. |
output_options |
A named character vector with additional options. If you need
more than the default indentaion, you have to provide it directly (see default
values for |
engine |
Character string defining the |
csl |
Character string defining a CSL style file for the bibliography.
Please note that you will have to provide an existing file of that name in an
appropriate location, like the *.Rmd file's directory. Ignored if |
eval |
Logical, a default value for all R code chunks that are found. This is
like a safety net to be able to disable all code by default. Setting the default
value will be omitted if set to |
replace |
An optional list of named character vectors with regular expressions
to do custom replacements in the text body. The list must contain vectors with
two character elements named |
flattr_id |
Character string, the ID value of your Flattr meta tag. If set will be added to the header of the resulting HTML file of the vignette. |
write_file |
Logical, if set to |
overwrite |
Logical, whether existing files should be overwritten if |
[1] https://gist.github.com/mikelove/5618f935ace6e389d3fbac03224860cd
[2] https://gist.github.com/lgatto/d9d0e3afcc0a4417e5084e5ca46a4d9e
[1] https://gist.github.com/mikelove/5618f935ace6e389d3fbac03224860cd
[2] https://gist.github.com/lgatto/d9d0e3afcc0a4417e5084e5ca46a4d9e
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run:
rnw2rmd(file.path(find.package("roxyPackage"),"doc","roxyPackage_vignette.Rnw"))
# use a fancy theme (not so good for CRAN, bloats the HTML file)
rnw2rmd(
file.path(find.package("roxyPackage"),"doc","roxyPackage_vignette.Rnw"),
output="html_document",
output_options=c(
theme="cerulean",
highlight="kate",
toc="true",
toc_float="\n collapsed: false\n smooth_scroll: false",
toc_depth=3
)
)
## End(Not run)
## Not run:
rnw2rmd(file.path(find.package("roxyPackage"), "doc", "roxyPackage_vignette.Rnw"))
# use a fancy theme (not so good for CRAN, bloats the HTML file)
rnw2rmd(
file.path(find.package("roxyPackage"), "doc", "roxyPackage_vignette.Rnw"),
output = "html_document",
output_options = c(
theme = "cerulean",
highlight = "kate",
toc = "true",
toc_float = "\\n collapsed: false\\n smooth_scroll: false",
toc_depth = 3
)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.