[R] pasting several things

chuck.01 CharlieTheBrown77 at gmail.com
Fri Mar 2 21:39:26 CET 2012


I have this type of format:

structure(list(day = 19, C1 = structure(1L, .Label = c("", "C1"
), class = "factor"), C2 = structure(2L, .Label = c("", "C2"), class =
"factor"), 
    C3 = structure(1L, .Label = c("", "C3"), class = "factor"), 
    Q1 = structure(2L, .Label = c("", "Q1"), class = "factor"), 
    Q2 = structure(2L, .Label = c("", "Q2"), class = "factor"), 
    Q3 = structure(1L, .Label = c("", "Q3"), class = "factor")), .Names =
c("day", 
"C1", "C2", "C3", "Q1", "Q2", "Q3"), row.names = "8", class = "data.frame")
> 

and want something like this:

 19 -C2 _Q1_Q2  

any ideas?  obviously I could use paste() and get this.  Keep in mind I have
many of these and the presence of "C1", "C2", ... etc will vary.


Thanks. 

--
View this message in context: http://r.789695.n4.nabble.com/pasting-several-things-tp4439770p4439770.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list