Ei Marcus,No meu caso, eu gostaria de ver a Function.cph, mas ela aparece com um asterisco que eu não sei o que é. Então...> Function.cphError: object 'Function.cph' not found> Function.cph*+E a função não aparece.Pedro BrasilEm 25 de agosto de 2017 13:37, Marcus Nunes <marcus.nunes@gmail.com> escreveu:Use `methods` para encontrar os métodos da função desejada:> methods(Function)[1] Function.areg.boot Function.transcansee '?methods' for accessing help and source codeEsta função tem dois métodos associados a ela: Function.areg.boot e Function.transcan. Agora é só pedir pra ver o código fonte do método que te interessa:> Function.areg.bootfunction (object, type = c("list", "individual"), ytype = c("transformed","inverse"), prefix = ".", suffix = "", pos = -1, ...){type <- match.arg(type)ytype <- match.arg(ytype)if (missing(type) && !(missing(prefix) & missing(suffix) &missing(pos)))type <- "individual"fit <- object$fitk <- length(fit)nam <- names(fit)g <- vector("list", k)xtype <- object$xtypetypey <- object$ytypecatl <- object$cat.levelsnames(g) <- namfor (i in 1:k) {typ <- if (i == 1)typeyelse xtype[i - 1]if (typ == "c") {if (i == 1 && ytype == "inverse")stop("currently does not handle ytype=\\"inverse\\" when y is categorical")h <- function(x, trantab) {if (is.factor(x))x <- as.character(x)trantab[x]}w <- fit[[i]]$ynames(w) <- catl[[nam[i]]]formals(h) <- list(x = numeric(0), trantab = w)}else {h <- function(x, trantab) {s <- !is.na(x)res <- rep(NA, length(x))res[s] <- approxExtrap(trantab, xout = x[s])$yres}fiti <- fit[[i]]formals(h) <- list(x = numeric(0), trantab = if (i ==1 && ytype == "transformed") list(x = fiti[[2]],y = fiti[[1]]) else fiti)}g[[i]] <- h}if (type == "list")return(g)fun.name <- paste(prefix, nam, suffix, sep = "")for (i in 1:k) assign(fun.name[i], g[[i]], pos = pos)invisible(fun.name)}<environment: namespace:Hmisc>--Marcus NunesProfessor AdjuntoUniversidade Federal do Rio Grande do NorteCentro de Ciências Exatas e da TerraDepartamento de EstatísticaLaboratório de Estatística Aplicada2017-08-25 13:21 GMT-03:00 Pedro Emmanuel Alvarenga Americano do Brasil via R-br <r-br@listas.c3sl.ufpr.br>:______________________________Amigos de R,Gostaria de poder ver a sequencia de operações que uma função faz. Na maioria das funções, basta digitar o nome da função no console, por exemplo> trimwsfunction (x, which = c("both", "left", "right")){which <- match.arg(which)mysub <- function(re, x) sub(re, "", x, perl = TRUE)if (which == "left")return(mysub("^[ \t\r\n]+", x))if (which == "right")return(mysub("[ \t\r\n]+$", x))mysub("[ \t\r\n]+$", mysub("^[ \t\r\n]+", x))}<bytecode: 0x0000000002fdbd78><environment: namespace:base>No entanto, algumas funções não seguem essa regra e eu não sei como fazer. Por exemplolibrary(Hmisc)> Functionfunction (object, ...)UseMethod("Function")<environment: namespace:Hmisc>Alguma dica pra conseguir enxergar as operações dessa função?Abraço forte,Pedro Brasil_________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia ) e forneça código mínimo reproduzível.
_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia ) e forneça código mínimo reproduzível.