Dear Paul, How about do.call("rgb", as.list(offred.rgb)) ?
I hope that this helps, John On Wed, 15 Sep 2004 15:20:24 -0500 (CDT) Paul Roebuck <[EMAIL PROTECTED]> wrote: > Is there a means to split a vector into its individual > elements without going the brute-force route for arguments > to a predefined function call? > > offred.rgb <- c(1, 0, 0) * 0.60; > > ## Brute force style > offred.col <- rgb(offred.rgb[1], > offred.rgb[2], > offred.rgb[3], > names = "offred") > ## Desired style > offred.col <- rgb(silver.bullet(offred.rgb), > names = "offred") > > Neither of my attempts gets it right. > > silver.bullet.try1 <- function(x) { > expr <- cat(x, sep = ",") > return(parse(text = expr)) > } > > silver.bullet.try2 <- function(x) { > expr <- expression(cat(x, sep = ",")) > return(eval(expr)) > } > > ---------------------------------------------------------- > SIGSIG -- signature too long (core dumped) > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html -------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html