rstring

0th

Percentile

Evaluates an RSP string and returns the generated string

Evaluates an RSP string and returns the generated string.

Keywords
file, IO
Usage
# S3 method for default
rstring(..., file=NULL, path=NULL, envir=parent.frame(), args="*", verbose=FALSE)
Arguments
...

A character string with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

envir

The environment in which the RSP string is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

verbose

See Verbose.

Value

Returns an RspStringProduct.

See Also

To display the output (instead of returning a string), see rcat(). For evaluating and postprocessing an RSP document and writing the output to a file, see rfile().

Aliases
  • rstring.default
  • rstring
  • rstring.RspString
  • rstring.RspDocument
  • rstring.RspSourceCode
  • rstring.function
  • rstring.expression
Examples
# NOT RUN {
x <- rstring("A random integer in [1,100]: <%=sample(1:100, size=1)%>\n")
cat(x)

# Passing arguments
x <- rstring("A random integer in [1,<%=K%>]: <%=sample(1:K, size=1)%>\n", args=list(K=50))
cat(x)
# }
Documentation reproduced from package R.rsp, version 0.43.1, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.