Skip to content
Prev 275319 / 398503 Next

How to create a new variable based on parts of another character variable.

Hi

If you want to get rid of regular expressions at all and your A values 
start AWI for Arctic and UFT for boreal you can

DF$D <- ifelse(substr(DF$A, 1,1) == "A", "Arctic", "Boreal")

Regards
Petr
problem
then
etc.
means
but
http://www.R-project.org/posting-guide.html