Re: [R] monthly sum

2014-03-31 Thread Rui Barradas
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), S = c("0.00", "4.83", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.51", "0.00", "

Re: [R] monthly sum

2014-03-31 Thread Rui Barradas
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), S = c("0.00", "4.83", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "

Re: [R] monthly sum

2014-03-31 Thread William Dunlap
.. $ S : chr "0.00" "4.83" "0.00" "0.00" ... $ T : chr NA NA NA NA ... $ U : num NA NA NA NA NA NA NA NA NA NA ... Bill Dunlap TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-he

Re: [R] monthly sum

2014-03-31 Thread eliza botto
A_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), R = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_rea

Re: [R] monthly sum

2014-03-31 Thread Rui Barradas
working. I am getting the following error. Error in FUN(X[[1L]], ...) : invalid 'type' (character) of argument Any idea? :( Thanks, Eliza > Date: Mon, 31 Mar 2014 18:48:08 +0100 > From: ruipbarra...@sapo.pt > To: eliza_bo...@hotmail.com; r-help@r-project.org > Subjec

Re: [R] monthly sum

2014-03-31 Thread eliza botto
t > To: eliza_bo...@hotmail.com; r-help@r-project.org > Subject: Re: [R] monthly sum > > Hello, > > Maybe the following will do. > > > library(zoo) > ym <- as.yearmon(dat$Date, "%d-%B-%y") > aggregate(dat[,-1], list(ym), FUN = sum, na.rm = TRUE) > &

Re: [R] monthly sum

2014-03-31 Thread Rui Barradas
Hello, Maybe the following will do. library(zoo) ym <- as.yearmon(dat$Date, "%d-%B-%y") aggregate(dat[,-1], list(ym), FUN = sum, na.rm = TRUE) Also, please use dput() to post data examples. Hope this helps, Rui Barradas Em 31-03-2014 18:31, eliza botto escreveu: Dear useRs, I have the dat

[R] monthly sum

2014-03-31 Thread eliza botto
Dear useRs, I have the data of following format. I have only pasted some part of the data. The data starts from 1961 and ends up in december 1987. dat <- read.table(text="Date A B C D1-Jan-61 0.00 1.27 8.128 0.252-Jan-61 6.10 9.144 94.742 15.493-Jan-61 0.00 0.508 1.27 0.004-Jan-61 0.00 0 NA 0.00