updatingScript

0th

Percentile

Create a Script object that re-reads the original file as needed

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.

Keywords
programming
Usage
updatingScript(doc, ...)
Arguments
doc

the name/location of the document containing the R code

any additional arguments, passed to readScript.

Details

This uses a reference class to update state across calls.

Value

an object of class DynScript

See Also

readScript

Aliases
  • updatingScript
  • coerce,DynScript,Script-method
  • getInputs,DynScript-method
Examples
# NOT RUN {
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")
# }
Documentation reproduced from package CodeDepends, version 0.6.5, License: GPL

Community examples

Looks like there are no examples yet.