Learn R Programming

mindr (version 1.3.2)

r2md: Convert R code into (R) Markdown-syntax text

Description

Convert R code into (R) Markdown-syntax text

Usage

r2md(from = NA)

Arguments

from

Character. The source text of the (R) Markdown syntax text, the R code, the FreeMind mind map code, or the path to the directory.

Value

R markdown-syntax text.

Examples

Run this code
# NOT RUN {
input <- system.file("examples/mindr-r.R", package = "mindr")
input_txt <- readLines(input, encoding = "UTF-8")
output_txt <- r2md(from = input_txt)
output <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".Rmd")
writeLines(output_txt, output, useBytes = TRUE)
# file.show(input) # Open the input file file.show(output) # Open the output
# file
message("Input:  ", input, "\nOutput: ", output)
# file.remove(output) # remove the output file
# }

Run the code above in your browser using DataLab