Skip to content
Prev 359075 / 398502 Next

Extracting part of a factor

I guess this thread has gone on long enough, but I haven't seen anyone
yet suggest what to me seems like the obvious thing if you want to do
this with mutate, namely

testdata <- mutate(testdata, place = as.factor(substr(subject, 1, 3)))

Best,
Ista
On Fri, Mar 4, 2016 at 10:45 PM, Boris Steipe <boris.steipe at utoronto.ca> wrote: