Hi all,

It seems like I cannot use normal 'if' for data frames. What would be the
best way to do the following.

if data$col1='high'
    data$col2='H'
else if data$col1='Neutral'
    data$col2='N'
else if data$col='low'
   data$col2='L'
else
   #chuch a warning?


Note that col2 was not an existing column and was newly assigned for this
task.

Thanks,
Sachin

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to