Skip to content
Prev 328236 / 398498 Next

Splitting a categorical variable into multiple variables

... or if you want to keep the unchanged levels the same:

zz <- factor(ifelse( z %in% c("a", "b"),"d" ,levels(z)[z]))

-- Bert
On Fri, Aug 9, 2013 at 7:35 AM, Bert Gunter <bgunter at gene.com> wrote: