Displaying 2 results from an estimated 2 matches for "importimage".
2011 May 04
1
Reference Classes: replacing '.self' with an .Rda image of '.self' from within a method? (was replacing '.self' with an .Rda image of '.self' from within a method?)
...'.self'
(e.g. a locally stored .Rda file) from within a method?
I know that this might sound akward, but here's the use case:
1) Ref Class Definition
setRefClass(Class="Test",
fields=list(A="character", B="character"),
methods=list(importImage=function(path){
variable <- load(path)
expr <- paste("assign('", variable, "',", variable, ",
envir=.self)", sep="")
eval(parse(text=expr))
}
)
2) Initialize Method Definition
setMethod(...
2011 May 02
0
Replacing '.self' with an .Rda image of '.self' from within a method?
...'.self'
(e.g. a locally stored .Rda file) from within a method?
I know that this might sound akward, but here's the use case:
1) Ref Class Definition
setRefClass(Class="Test",
fields=list(A="character", B="character"),
methods=list(importImage=function(path){
variable <- load(path)
expr <- paste("assign('", variable, "',", variable, ",
envir=.self)", sep="")
eval(parse(text=expr))
}
)
2) Initialize Method Definition
setMethod(...