updatingScript | R Documentation |
This function reads the code in a particular document
and creates a Script-class
object
to represent the code and allow us to do analysis
on that code.
Unlike readScript
, this object
continues to read any updates to the original code file
when we use this Script
object in computations.
This allows us to modify the original source interactively
and concurrently with our R session and still have the
script remain up-to-date with that code.
updatingScript(doc, ...)
doc |
the name/location of the document containing the R code |
... |
any additional arguments, passed to |
This uses a reference class to update state across calls.
an object of class DynScript
Duncan Temple Lang
readScript
cat("x = 1:10\ny = 3*x + 7 + rnorm(length(x))\n", file = "foo.R")
sc = updatingScript("foo.R")
as(sc, "Script")
con = file("foo.R", "at")
cat("z = x + y", file = con)
close(con)
as(sc, "Script")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.