Skip to contents

This function is derived from spMisc. See also: https://rdrr.io/github/GegznaV/spMisc/src/R/rnw2rmd.R. It can 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.

Usage

rnw2rmd(
  file,
  output_file = gsub("[Rr]nw$", "Rmd", file),
  output_format = "rmarkdown::html_vignette",
  extra_replacement = NULL,
  overwrite = FALSE
)

Arguments

file

Path to an *.Rnw file to convert.

output_file

Path to write *.Rmd file.

output_format

Character string defining the R markdown output format.

extra_replacement

a list of file to specify additional replacement.

overwrite

Logical, whether existing files should be overwritten.

Value

Open the output to enable further edition.