r factor - R how to change one of the level to NA -
i have data set , 1 of column has factor levels "a" "b" "c" "notperformed"
. how can change "notperformed"
factors na?
set level na:
x <- factor(c("a", "b", "c", "notperformed")) x ## [1] b c notperformed ## levels: b c notperformed levels(x)[levels(x)=='notperformed'] <- na x ## [1] b c <na> ## levels: b c
note factor level removed.
Comments
Post a Comment