Rolf Turner wrote:
>
> The issue worrying Wacek was presumably the fact that
> the original poster was treating the ``B'' variable as
> being character, rather than numeric.
>
> So (presumably) what he *really* wanted to say was
> (something like)
>
> ifelse(B%in%as.character(0:9),"A","B")

yepp.

>
> Of course this is sheer pedantry.  

thanks, you're so reliable.

> I'm sure the original poster
> was really concerned with a numeric variable and used the quote
> marks around the digits out of confusion over what was required.
> (Some misguided subconscious notion to the effect that to get character
> output you need character input.)

in any case, the version you propose should do the job.

vQ

______________________________________________
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