[R] Dealing with data

TGS cran.questions at gmail.com
Fri Aug 13 19:22:19 CEST 2010


To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc.

For instance, "A" gets "1", "B" gets "2", and so on.

On Aug 13, 2010, at 10:19 AM, David Winsemius wrote:


On Aug 13, 2010, at 1:03 PM, TGS wrote:

> # how would I code in R to look at the letter of the alphabet
> # in the second column and create a indicator column for the
> # corresponding letter?
> 
> data(InsectSprays)
> InsectSprays$spray

It's already what most people mean when they say "indicator column", i.e., a factor variable (and not a character vector) .... so,  what do _you_ mean?
> 


-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list