Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove or find NaN in R

Tags:

r

I have a data.frame x2 as

> x2
    x2
 1 NaN
 2 0.1
 3 NaN
 4 0.2
 5 0.3

I would like to remove the NaN from this column. Is there a quick way to do that?

like image 481
user297850 Avatar asked Feb 25 '14 13:02

user297850


1 Answers

x2 <- na.omit(x2)

may work for you.

like image 194
lennon310 Avatar answered Jan 01 '23 20:01

lennon310