Displaying 1 result from an estimated 1 matches for "myclassobj_2".
Did you mean:
myclassobj_1
2009 Jul 21
0
Accessing list object from within a function as a list element
...the
'myfunc' function to use 'myvar.' Here is a simple example:
mylist <- list();
mylist$myvar <- "~/file.out";
mylist$myfunc <- function (mymsg="hello world") {
cat(mymsg,mylist$myvar); };
If I perform the following:
myclassobj_1 <- myclassobj_2 <- myclassobj_3 <- mylist;
myclassobj_1 <- "~/file_1.out";
myclassobj_2 <- "~/file_2.out";
myclassobj_3 <- "~/file_3.out";
I cannot use myclassobj_1$myfunc() as it will place "hello world" into
"~/file.out" instead of &qu...