Hello All,
Thanks in advance for all help.
In my prog, I have a global list object that is used as a container for storing
some data frames.
Here is an example code.
--SNIP--
temp1 <- function(X){
statName = c("Mean", "stdDev", "NumSamples")
statVal = c("0.5", "0.51", "5")
r = data.frame(statName=statName, statVal = statVal)
X[["temp1"]] = r
}
reportList = list()
temp1(reportList)
print(reportList)
--SNIP--
I was expecting that the new data frame in temp1 would get added to the list
(reportList), but it doesn't, probably because, arguments to functions are
passed "Call-by-value" and loose all locally made changes.
Any ideas how I can do this.
Shank
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.