[R] Splitting vector into individual elements

Gabor Grothendieck ggrothendieck at myway.com
Wed Sep 15 22:49:55 CEST 2004


Paul Roebuck <roebuck <at> odin.mdacc.tmc.edu> writes:
 
: 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")


See:

http://maths.newcastle.edu.au/~rking/R/help/03a/7417.html




More information about the R-help mailing list