search for: secret_value

Displaying 1 result from an estimated 1 matches for "secret_value".

Did you mean: secret_val
2012 Feb 21
1
Private Variables in R5-Classes possible?
Hi list, is there a way to define some kind of private Variable? I would like to prevent the user from manipulating fields on his own, in order to not destroy data structures. The problem is, that as soon as the variable exists in the environment it is accessible via t$secret_value. test <- setRefClass("test", fields=list( secret = function(value){ cat("the function was called\n") if(missing(value)){ if(exists("secret_value", envir=.self at .xData)){ return(get("secret_value", envir=.self at .xData, inherits = F)) } else{ return(NUL...