On Mar 30, 2011, at 11:52 AM, Gabor Grothendieck wrote:
> On Wed, Mar 30, 2011 at 11:51 AM, 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
On Wed, Mar 30, 2011 at 10:51 AM, 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,
> > Chr
On Wed, Mar 30, 2011 at 11:51 AM, 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
>
> De
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 BowmanINTERNET: cl...@ecy.wa.gov
Air Quality Modeler INTER
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 fac
Ah ... yes. I knew that but clearly didn't at the time of my question or
script writing.
Thanks,
Chris
On Wed, Mar 30, 2011 at 8:22 AM, Henrique Dallazuanna wrote:
> Try:
>
> dat0 <- read.table('tim1.dat', na = -999)
>
Ah ... yes. I knew that but clearly didn't at the time of my question or
scri
Try using a loop like the following
dat0 <- read.table("time1.dat")
id <- c("e1dq", "e1arcp", "e1dev", "s1prcp", "s1nrcp","s1ints","a1gpar", "a1pias",
"a1devt")
for (a in 1:length(id)) {
dat0[dat0$id[a]==-999.,as.character(id[a])] <- NA
}
--
Muhammad Rahiz
Researcher & DPhil Candi
It could be done in a large number of ways depending on how often you
need it etc.
You might take a look at defmacro in package gtools:
# library(gtools)
setNA <- macro(df, var, values)
{
df$var[df$var %in% values] <- NA
}
then instead of
> dat0[dat0$e1dq==-999.,"e1dq"] <- NA
you coul
On Wed, 2011-03-30 at 08:15 -0500, Christopher Desjardins wrote:
> Hi,
> I am trying to write a loop to recode my data from -999 to NA in R. What's
> the most efficient way to do this? Below is what I'm presently doing, which
> is inefficient. Thanks,
> Chris
>
>
>dat0 <- read.table("time1.da
Am 30.03.2011 09:15, schrieb Christopher Desjardins:
Hi,
I am trying to write a loop to recode my data from -999 to NA in R. What's
the most efficient way to do this? Below is what I'm presently doing, which
is inefficient. Thanks,
Chris
dat0<- read.table("time1.dat")
colnames(dat0)<- c("e
On 30.03.2011 15:15, Christopher Desjardins wrote:
Hi,
I am trying to write a loop to recode my data from -999 to NA in R. What's
the most efficient way to do this? Below is what I'm presently doing, which
is inefficient. Thanks,
Chris
I think read.table(na.string="-999.") is.
Uwe
Try:
dat0 <- read.table('tim1.dat', na = -999)
On Wed, Mar 30, 2011 at 10:15 AM, Christopher Desjardins
wrote:
> Hi,
> I am trying to write a loop to recode my data from -999 to NA in R. What's
> the most efficient way to do this? Below is what I'm presently doing, which
> is inefficient. Thanks
12 matches
Mail list logo