[R] Dealing with data
Erik Iverson
eriki at ccbr.umn.edu
Fri Aug 13 19:35:06 CEST 2010
TGS wrote:
> 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.
That's precisely how factors are handled by modeling functions in R!
No need to reinvent the wheel. You should probably read a document
or book describing introductory regression methods in R.
>
> 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?
>
>
More information about the R-help
mailing list