[R] Return one value, print another

Dieter Menne dieter.menne at menne-biomed.de
Fri Mar 12 15:17:39 CET 2010

Miguel Porto wrote:
> Hmm... do something like that, no need to change the global option (I used
> a
> named vector instead of a list, it's more convenient):
> eg <- function(x, digits=4) {
> xbar <- mean(x)
> sdx <- sd(x)
> value <- c(xbar, sdx)
> names(value) <- c("Mean of X", "SD of X")
> print(round(value,digits));
> return(invisible(value))}

Would be ok, but Josh explicitly had no print in the function, so one could
assume that he wanted full control.

View this message in context: http://n4.nabble.com/Return-one-value-print-another-tp1590248p1590563.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list