scriptTests/SourceFunc/SourceFunc.R

fun <- function(a,b){
  return(a+b)
}

x <- 6
y <- 10
z <- fun(x,y)

# source a script which actually used z and sets w in the global environment
prov.source("../source1.r")

# use w and new z value
v <- fun(w,z)

# then script without them
prov.source("../source3.r")

# a script which we call with a local environment
prov.source("../source4.r")

# source which tets the local aspect of this thing!

# another script, we ignore everything but do it all on a new environment

# we use some of the variables set in source3.r
m <- 10
f1(m)
f1(x)
End-to-end-provenance/rdt documentation built on Aug. 11, 2022, 12:55 p.m.