OOPs clumsy cut and paste. :( --- On Tue, 8/18/09, Uwe Ligges <lig...@statistik.tu-dortmund.de> wrote:
> From: Uwe Ligges <lig...@statistik.tu-dortmund.de> > Subject: Re: [R] Replacing NA values in one column of a data.frame > To: "John Kane" <jrkrid...@yahoo.ca> > Cc: r-help@r-project.org, "Steve Murray" <smurray...@hotmail.com> > Received: Tuesday, August 18, 2009, 10:25 AM > > > John Kane wrote: > > Perhaps > > testdata$onecolumn[testdata$onecolumn==NA] <- 9999 > > > > Well, with is.na() there is a much better chance to make it > work > > Uwe Ligges > > > > > > --- On Mon, 8/17/09, Steve Murray <smurray...@hotmail.com> > wrote: > > > >> From: Steve Murray <smurray...@hotmail.com> > >> Subject: [R] Replacing NA values in one column of > a data.frame > >> To: r-help@r-project.org > >> Received: Monday, August 17, 2009, 11:41 AM > >> > >> Dear all, > >> > >> I'm trying to replace NA values with -9999 in one > column of > >> a data frame. I've tried using is.na and the > >> testdata[testdata$onecolumn==NA] <- 9999 > approach, but > >> whilst neither generate errors, neither result in > -9999s > >> appearing - the NAs remain there! > >> > >> I'd be grateful for any advice on what I'm doing > wrong or > >> any other suitable approaches. > >> > >> Many thanks, > >> > >> Steve > >> > >> > _________________________________________________________________ > >> > >> oticons. > >> > >> ______________________________________________ > >> 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. > >> > > > > > > > __________________________________________________________________ > > [[elided Yahoo spam]] > > > > ______________________________________________ > > 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. > __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ ______________________________________________ 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.