Ok, this is my finally (hopefully) clean session my.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE)), .Names = c("TEC","LR"), row.names = c(NA, -6L), class = "data.frame")
library("NADA") xx<-with(my.ex, cenfit(TEC,LR) ) xx mycenfit <- function(x) { s = summary(x) c(n = nrow(s), n.cen = nrow(s) - sum(s$n.event), median = median(x), mean = mean(x)[["mean"]], sd = sd(x), sum=mean(x)[["mean"]]*length(x)) } mycenfit(xx) thank you so much for your help (I still have much to fully understand S4 methods, R objects and functions) max -- View this message in context: http://r.789695.n4.nabble.com/How-to-modify-a-S4-function-in-the-package-NADA-tp4649586p4649613.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.