Displaying 1 result from an estimated 1 matches for "asquar".
Did you mean:
asquare
2010 Nov 23
1
Reference Classes: removing methods -> implications for objects/instances of that class
...ed of the respective class still feature the
removed method until I do an explicit reassign ('my.instance <-
getRefClass("Classname")$new()'), right?
setRefClass("Shab", fields=list(a="numeric"))
# Register method
getRefClass("Shab")$methods(list(aSquare=function() a^2))
getRefClass("Shab")$methods()
# Create instance
shab <- getRefClass("Shab")$new()
shab$a <- 10
# Use method
shab$aSquare()
# Remove method
getRefClass("Shab")$methods(list(aSquare=NULL))
getRefClass("Shab")$methods() # Gone.
sha...