Skip to content
Back to formatted view

Raw Message

Message-ID: <4DD47663-4F40-44AF-A6B6-196B1A4FAD2A@comcast.net>
Date: 2009-05-01T19:04:32Z
From: David Winsemius
Subject: combine column names
In-Reply-To: <49FAFF53.A0BA.00E8.0@entomology.wisc.edu>

On May 1, 2009, at 2:55 PM, SEUNG CHEON HONG wrote:

> Dear R-list,
>
> Is there any way I can extract part or whole column name from two
> variables and combine them? Not values, but column names.
> For example,
> I have data set with 70 variables. The column names are "Alfalfa",
> "Corn","Soybean",..."Sunflower". After I combine the two variable (say
> Alfalfa and Corn), I want to rename it as "AlfCor" or "AlfalfaCorn"
> automatically not manually.
>
> In excel, I found the function combining two texts in individual
> columns using (=A1&B1, if you want to combine texts in the two  
> cells.).

?paste
?colnames

David Winsemius, MD
Heritage Laboratories
West Hartford, CT