Check out this website for a couple examples of how to use transform()
and replace() - (look under recode):
http://www.ku.edu/~pauljohn/R/Rtips.html
-Andrea
>Hello,
>
>I have read through the manuals and can't seem to find an answer.
>
>I have a categorical, character variable that has hundr
"Martin Henry H. Stevens" <[EMAIL PROTECTED]> 10/20/05 08:47AM
>>>
>Hi Avram-
>How many countries do you have?
>I would do it the following way because it is simple and I don't know
>any better, even if it is absurdly painstaking.
>
>#Step 1
>mydata$continent <- factor(NA, levels=c("NoAm","
Hi Avram-
How many countries do you have?
I would do it the following way because it is simple and I don't know
any better, even if it is absurdly painstaking.
#Step 1
mydata$continent <- factor(NA, levels=c("NoAm","Euro"))
#Steps 2 a-z
mydata$continent[mydata$country=="US" |
I suggest you use the recode function in car package to do your job.
=== 2005-10-20 08:09:08 您在来信中写道:===
>Hello,
>
>I have read through the manuals and can't seem to find an answer.
>
>I have a categorical, character variable that has hundreds of values. I want
>to group the ex
Hello,
I have read through the manuals and can't seem to find an answer.
I have a categorical, character variable that has hundreds of values. I want
to group the existing values of this variable into a new, derived (categorical)
variable by applying conditions to the values in the data.
For