Re: [R] Aggregate rainfall data

2016-07-19 Thread roslinazairimah zakaria
Hi David, Thank you so much for your help and others. Here is the code. balok <- read.csv("G:/A_backup 11 mei 2015/DATA (D)/1 Universiti Malaysia Pahang/ISM-3 2016 UM/Data/Hourly Rainfall/balok2.csv",header=TRUE) head(balok, 10); tail(balok, 10) str(balok) ## Introduce NAs for balok$Rain.mm2 <-

Re: [R] Aggregate rainfall data

2016-07-13 Thread David Winsemius
> On Jul 13, 2016, at 3:21 AM, roslinazairimah zakaria > wrote: > > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > > I tried : balok <- cbind(balok3[,-5], balok3$Rain.mm[balok3$Rain.mm==0.0?] <- > NA) If you had done as I suggested, the items with factor

Re: [R] Aggregate rainfall data

2016-07-13 Thread PIKAL Petr
Behalf Of > roslinazairimah zakaria > Sent: Wednesday, July 13, 2016 12:22 PM > To: David Winsemius > Cc: r-help mailing list > Subject: Re: [R] Aggregate rainfall data > > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > &

Re: [R] Aggregate rainfall data

2016-07-13 Thread boB Rudis
use `gsub()` after the `as.character()` conversion to remove everything but valid numeric components from the strings. On Wed, Jul 13, 2016 at 6:21 AM, roslinazairimah zakaria wrote: > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > > I tried : balok <- cbind(ba

Re: [R] Aggregate rainfall data

2016-07-13 Thread roslinazairimah zakaria
Dear David, I got your point. How do I remove the data that contain "0.0?". I tried : balok <- cbind(balok3[,-5], balok3$Rain.mm[balok3$Rain.mm==0.0?] <- NA) However all the Rain.mm column all become NA. day month year Time balok3$Rain.mm[balok3$Rain.mm == "0.0?"] <- NA 1 30 7 200

Re: [R] Aggregate rainfall data

2016-07-12 Thread David Winsemius
> On Jul 12, 2016, at 3:45 PM, roslinazairimah zakaria > wrote: > > Dear R-users, > > I have these data: > > head(balok, 10); tail(balok, 10) >Date Time Rain.mm > 1 30/7/2008 9:00:00 0 > 2 30/7/2008 10:00:00 0 > 3 30/7/2008 11:00:00 0 > 4 30/7/2008 12:00:00

[R] Aggregate rainfall data

2016-07-12 Thread roslinazairimah zakaria
Dear R-users, I have these data: head(balok, 10); tail(balok, 10) Date Time Rain.mm 1 30/7/2008 9:00:00 0 2 30/7/2008 10:00:00 0 3 30/7/2008 11:00:00 0 4 30/7/2008 12:00:00 0 5 30/7/2008 13:00:00 0 6 30/7/2008 14:00:00 0 7 30/7/2008 15:00:00