[R] How to create a mixed col.names?

Jonas Malmros jonas.malmros at gmail.com
Mon Dec 17 15:08:09 CET 2007


Hello,

I have a vector of names, say :

names <- c("Factor 1", "Factor 2", Factor 3")

I am creating a dataframe and I want the column names to be mixed like this:
"Factor 1" " Sign Factor 1" "Factor 2" "Sign Factor 2" "Factor 3"
"Sign Factor 3"
How can I automate the creation of such a mixed vector? I tried with
rep but did not succeed.

Could someone please suggest a solution to this problem?
Thanks in advance!

Regards,
JM
-- 
Jonas Malmros
Stockholm University
Stockholm, Sweden



More information about the R-help mailing list