No -- my answer is wrong. I'll leave it to others to correct. Obvious question to OP: What if more than one of your colors variables simultaneously have a 1?
-- Bert On Mon, May 13, 2013 at 8:09 AM, Bert Gunter <bgun...@gene.com> wrote: > Cute answer, Pascal. It may even be the answer to the question the OP > should have asked, but I don't think it answered the question that was > asked. That might be: > > c("red"[red], "green"[green], "blue"[blue]) > > Cheers, > Bert > > On Mon, May 13, 2013 at 7:36 AM, Pascal Oettli <kri...@ymail.com> wrote: >> Hi, >> >> ?rgb >> >> HTH >> Pascal >> >> >> 2013/5/13 David Studer <stude...@gmail.com> >> >>> Hello everybody, >>> >>> I have three variables "blue", "green" and "red" containing values 0 (no) >>> and 1 (yes). >>> >>> How can I easily create another variable "colors" with the values "blue", >>> "green" and "red"? >>> >>> I hope that you can understand my question and appreciate any solutions or >>> hints! >>> >>> Thank you! >>> David >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.