On 21/10/19 11:07 AM, Rui Barradas wrote:
Hello,
Sorry, you're right, in the method it's x, X is the test dataframe.
Repost:
`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else
length(cols) == 1){
SaveAt <- lapply(x, attributes)
x <- NextMethod()
lX <- lapply(names(x),function(nm, x, Sat){
attributes(x[[nm]]) <- Sat[[nm]]
x[[nm]]}, x = x, Sat = SaveAt)
names(lX) <- names(x)
x <- as.data.frame(lX)
x
}
The (frequent) error comes from tests where a X was created in the
globalenv and found by the method.
Yep! Happens to me all the time! :-)
Thanks very much.
cheers,
Rolf
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.