You want to set the "names" attribute of your results vector. You can do
this with the names() function (see ?names). Specifically, you might use
something like this:
results <- c(se, upper, lower, cv)
names(results) <- c("se", "upper", "lower", "cv")
Good luck,
Ian
Stropharia wr
help@r-project.org
Subject: [R] Re turning variable names with variables (in a function)
Dear R Users,
I have written a function that returns 4 variables. I would like to have
the
variables returned with their variable names, is this possible?
-
Dear R Users,
I have written a function that returns 4 variables. I would like to have the
variables returned with their variable names, is this possible?
- R Code -
mc.error <- function(T, p=0.05){
se <- sqrt((p)*(1-(p))/T) # standard
3 matches
Mail list logo