Reads in an Rmd file or an R script and converts it to a list of TreeHarp objects.
The filename that is to be read in.
A logical value, indicating if the line numbers of expressions should be returned along with the expressions. By default, this value is FALSE.
The TreeHarp constructor is wrapped in a tryCatch loop, so that it does not fail if an expression could not be converted to a TreeHarp object.
The object returned is not a specially defined class. It is either a list of
length 2, or a list of TreeHarp objects. This output is meant to be used
If the input file is an Rmd file (checked with extract_chunks), then the chunks are extracted and converted to TreeHarp objects. If the input file is not an Rmd, it is assumed to be an R script. This script is then supplied to parse. In either case, a parsing error here could cause the function to fail.
Line numbers are extracted using
the lintr package.
A list of TreeHarp objects, or a list with 2 components containing the TreeHarp objects and a vector of line numbers.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.