Hi, I have a dataframe with 14319rows and 9 colums. for some rows there are null values.I want a dataframe without these null values.I wanna select only those that have values !=NA. kindly let me know how to do that. Ramya -- View this message in context: http://www.nabble.com/selecting-dataframe-values-that-are-not-nulls-tp19537093p19537093.html Sent from the R help mailing list archive at Nabble.com.
On Sep 17, 2008, at 1:22 PM, Rajasekaramya wrote:> > Hi, > > I have a dataframe with 14319rows and 9 colums. for some rows there > are null > values.I want a dataframe without these null values.I wanna select > only > those that have values !=NA. > > kindly let me know how to do that.?is.na -- David Winsemius
Hi Ramya, In this particular case, something like ?"complete.cases" should do the job. With this function you can delete rows with one or more NA's. Here is an example: set.seed(123) DF<-matrix(rnorm(100),ncol=10) DF[1,2]<-NA DF[1,3]<-NA DF[4,10]<-NA dim(DF) [1] 10 10 DF.noNA <- DF[complete.cases(DF),] # Removing rows 1 and 4 dim(DF.noNA) [1] 8 10 HTH, Jorge On Wed, Sep 17, 2008 at 1:22 PM, Rajasekaramya <ramya.victory@gmail.com>wrote:> > Hi, > > I have a dataframe with 14319rows and 9 colums. for some rows there are > null > values.I want a dataframe without these null values.I wanna select only > those that have values !=NA. > > kindly let me know how to do that. > > Ramya > > -- > View this message in context: > http://www.nabble.com/selecting-dataframe-values-that-are-not-nulls-tp19537093p19537093.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Adaikalavan Ramasamy
2008-Sep-20 00:28 UTC
[R] selecting dataframe values that are not nulls
Ramya, you sent four near identical emails with different subject lines. Since the list is run by unpaid volunteers, please avoid wasting people's time (and yours too) with such redundancies. Please read http://www.r-project.org/posting-guide.html and search the mailing lists and documentations. Did you receive the replies to your 1st request from miltinho and Moshe? If not, have a look at help(merge) with the all.x, all.y and all argument. You might also be interested in unique, is.na, list. Regards, Adai Rajasekaramya wrote:> Hi, > > I have a dataframe with 14319rows and 9 colums. for some rows there are null > values.I want a dataframe without these null values.I wanna select only > those that have values !=NA. > > kindly let me know how to do that. > > Ramya >