rstring | R Documentation |
Evaluates an RSP string and returns the generated string.
## Default S3 method:
rstring(..., file=NULL, path=NULL, envir=parent.frame(), args="*", verbose=FALSE)
... |
A |
file , path |
Alternatively, a file, a URL or a |
envir |
The |
args |
A named |
verbose |
See |
Returns an RspStringProduct
.
Henrik Bengtsson
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
().
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.