knitxl {knitxl} | R Documentation |
Knit a Document to an XLSX file
Description
This function takes an input file, extracts the R code in it according to a list of patterns, evaluates the code and writes the output in an XLSX spreadsheet file.
Usage
knitxl(
input,
output = NULL,
text = NULL,
quiet = FALSE,
envir = parent.frame(),
encoding = "UTF-8"
)
Arguments
input |
Path to the input file. |
output |
Path to the output file for |
text |
A character vector. This is an alternative way to provide the input file. |
quiet |
Boolean; suppress the progress bar and messages? |
envir |
Environment in which code chunks are to be evaluated, for
example, |
encoding |
Encoding of the input file; always assumed to be UTF-8 (i.e., this argument is effectively ignored). |
Value
The compiled document is written into the output file, and the path of the output file is returned invisibly.
Examples
library(knitxl)
path_to_input <- system.file("examples", "knitxl-minimal.Rmd", package = "knitxl")
path_to_output <- "knitxl-minimal.xlsx"
knitxl(path_to_input, output = path_to_output) # will generate knitxl-minimal.xlsx
unlink(path_to_output)