| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/options.R |
| 3 |
\name{evalsOptions} |
| 4 |
\alias{evalsOptions} |
| 5 |
\title{Querying/setting evals option} |
| 6 |
\usage{ |
| 7 |
evalsOptions(o, value) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{o}{option name (string). See below.} |
| 11 |
|
| 12 |
\item{value}{value to assign (optional)} |
| 13 |
} |
| 14 |
\description{ |
| 15 |
To list all \code{evals} options, just run this function without any parameters provided. To query only one value, pass the first parameter. To set that, use the \code{value} parameter too. |
| 16 |
} |
| 17 |
\details{ |
| 18 |
The following \code{evals} options are available: |
| 19 |
|
| 20 |
\itemize{ |
| 21 |
\item \code{parse}: if \code{TRUE} the provided \code{txt} elements would be merged into one string and parsed to logical chunks. This is useful if you would want to get separate results of your code parts - not just the last returned value, but you are passing the whole script in one string. To manually lock lines to each other (e.g. calling a \code{plot} and on next line adding an \code{abline} or \code{text} to it), use a plus char (\code{+}) at the beginning of each line which should be evaluated with the previous one(s). If set to \code{FALSE}, \code{evals} would not try to parse R code, it would get evaluated in separate runs - as provided. Please see examples of \code{\link{evals}}. |
| 22 |
\item \code{cache}: caching the result of R calls if set to \code{TRUE} |
| 23 |
\item \code{cache.mode}: cached results could be stored in an \code{environment} in \emph{current} R session or let it be permanent on \code{disk}. |
| 24 |
\item \code{cache.dir}: path to a directory holding cache files if \code{cache.mode} set to \code{disk}. Default to \code{.cache} in current working directory. |
| 25 |
\item \code{cache.time}: number of seconds to limit caching based on \code{proc.time}. If set to \code{0}, all R commands, if set to \code{Inf}, none is cached (despite the \code{cache} parameter). |
| 26 |
\item \code{cache.copy.images}: copy images to new files if an image is returned from cache? If set to \code{FALSE} (default) the "old" path would be returned. |
| 27 |
\item \code{classes}: a vector or list of classes which should be returned. If set to \code{NULL} (by default) all R objects will be returned. |
| 28 |
\item \code{hooks}: list of hooks to be run for given classes in the form of \code{list(class = fn)}. If you would also specify some parameters of the function, a list should be provided in the form of \code{list(fn, param1, param2=NULL)} etc. So the hooks would become \code{list(class1=list(fn, param1, param2=NULL), ...)}. See examples of \code{\link{evals}}. A default hook can be specified too by setting the class to \code{'default'}. This can be handy if you do not want to define separate methods/functions to each possible class, but automatically apply the default hook to all classes not mentioned in the list. You may also specify only one element in the list like: \code{hooks=list('default' = pander_return)}. Please note, that nor error/warning messages, nor stdout is captured (so: updated) while running hooks! |
| 29 |
\item \code{length}: any R object exceeding the specified length will not be returned. The default value (\code{Inf}) does not filter out any R objects. |
| 30 |
\item \code{output}: a character vector of required returned values. This might be useful if you are only interested in the \code{result}, and do not want to save/see e.g. \code{messages} or \code{print}ed \code{output}. See examples of \code{\link{evals}}. |
| 31 |
\item \code{graph.unify}: boolean (default: \code{FALSE}) that determines if \code{evals} should try to unify the style of (\code{base}, \code{lattice} and \code{ggplot2}) plots? If set to \code{TRUE}, some \code{panderOptions()} would apply. |
| 32 |
\item \code{graph.name}: set the file name of saved plots which is \code{\link{tempfile}} by default. A simple character string might be provided where \code{\%d} would be replaced by the index of the generating \code{txt} source, \code{\%n} with an incremented integer in \code{graph.dir} with similar file names and \code{\%t} by some random characters. A function's name to be \code{eval}uated can be passed here too. |
| 33 |
\item \code{graph.dir}: path to a directory where to place generated images. If the directory does not exist, \code{\link{evals}} try to create that. Default set to \code{plots} in current working directory. |
| 34 |
\item \code{graph.output}: set the required file format of saved plots. Currently it could be any of \code{grDevices}: \code{png}, \code{bmp}, \code{jpeg}, \code{jpg}, \code{tiff}, \code{svg} or \code{pdf}. Set to \code{NA} not to save plots at all and tweak that setting with \code{capture.plot()} on demand. |
| 35 |
\item \code{width}: width of generated plot in pixels for even vector formats |
| 36 |
\item \code{height}: height of generated plot in pixels for even vector formats |
| 37 |
\item \code{res}: nominal resolution in \code{ppi}. The height and width of vector images will be calculated based in this. |
| 38 |
\item \code{hi.res}: generate high resolution plots also? If set to \code{TRUE}, each R code parts resulting an image would be run twice. |
| 39 |
\item \code{hi.res.width}: width of generated high resolution plot in pixels for even vector formats. The \code{height} and \code{res} of high resolution image is automatically computed based on the above options to preserve original plot aspect ratio. |
| 40 |
\item \code{graph.env}: save the environments in which plots were generated to distinct files (based on \code{graph.name}) with \code{env} extension? |
| 41 |
\item \code{graph.recordplot}: save the plot via \code{recordPlot} to distinct files (based on \code{graph.name}) with \code{recodplot} extension? |
| 42 |
\item \code{graph.RDS}: save the raw R object returned (usually with \code{lattice} or \code{ggplot2}) while generating the plots to distinct files (based on \code{graph.name}) with \code{RDS} extension? |
| 43 |
\item \code{log}: \code{NULL} or an optionally passed \emph{namespace} from \pkg{logger} to record all info, trace, debug and error messages. |
| 44 |
} |
| 45 |
} |
| 46 |
\examples{ |
| 47 |
evalsOptions() |
| 48 |
evalsOptions('cache') |
| 49 |
evalsOptions('cache', FALSE) |
| 50 |
} |
| 51 |
\seealso{ |
| 52 |
\code{\link{evals}} \code{\link{panderOptions}} |
| 53 |
} |