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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -