Skip to content

How to create a new variable based on parts of another character variable: A generalization

2 messages · Bert Gunter, PIKAL Petr

#
Hi Bert

I am aware of factor features and frankly speaking I consider them quite 
usefull despite of prevalent preference to character vectors. For the OP 
question seems to me that ifelse construction is appropriate, based on his 
statement he has 2 strings which shall be converted to another two strings 
and that he is starting with R. I agree that for more levels to change, 
factor is the way to go.

Regards
Petr
general
factor(y[z])
which
example.
wrote:
string
etc.
http://www.R-project.org/posting-guide.html