requiRements (version 0.0.0.9000)

req_file: Extract requirements from a file

Description

* `.R`: extracts requirements from parsed code

* `.Rmd` & `.Rpres`: requirements from chunks (parsed using regular expressions to avoid dependency on knitr package). If rmarkdown package is installed, will also add requirements from custom output type.

* `.Rnw`: tangles the document and then extracts from `.R` file.

Usage

req_file(path)

Arguments

path

Path to file

Examples

Run this code
# NOT RUN {
path_r <- system.file("examples", "simple.R", package = "requirements")
path_rmd <- system.file("examples", "simple.Rmd", package = "requirements")

req_file(path_r)
req_file(path_rmd)
# }

Run the code above in your browser using DataLab