Re: [R] Quick recode of -999 to NA in R

From: Clint Bowman <clint_at_ecy.wa.gov>
Date: Wed, 30 Mar 2011 09:27:48 -0700 (PDT)

Amen. Ditto for "-999.000", "-999.00" and all of the other ones that various (usually Fortran) programmers have used. Has the most recent Fortran standard come around to understanding NA?

-- 
Clint Bowman			INTERNET:	clint_at_ecy.wa.gov
Air Quality Modeler		INTERNET:	clint_at_math.utah.edu
Department of Ecology		VOICE:		(360) 407-6815
PO Box 47600			FAX:		(360) 407-7534
Olympia, WA 98504-7600


         USPS:           PO Box 47600, Olympia, WA 98504-7600
         Parcels:        300 Desmond Drive, Lacey, WA 98503-1274


On Wed, 30 Mar 2011, peter dalgaard wrote:


>
> On Mar 30, 2011, at 16:05 , Christopher Desjardins wrote:
>
>>>
>>> dat0 <- read.table('tim1.dat', na = -999)
>>>
>>
>> Ah ... yes. I knew that but clearly didn't at the time of my question or
>> script writing.
>> Thanks,
>> Chris
>
> Depending on where your data came from, you could get caught by the fact that the above is really ...na.strings="-999"... and that is not going to work if the actual code is (say) -999.00.
>
> Another straightforward option is dat0[dat0 == -999] <- NA
>
>
>
______________________________________________ R-help_at_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.
Received on Wed 30 Mar 2011 - 16:33:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 17:00:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive