Re: [R] subset daily to monthly in a zoo or xts

2012-04-23 Thread Enrico Schumann
Hi Vikram, maybe something like this? require("zoo") ## a daily zoo series z <- zoo(1:200, as.Date("2012-01-01") + 1:200) ## add some NAs z[ceiling(runif(10)*200)] <- NA ## aggregate to monthly aggregate(z, format(index(z), "%Y-%m"), length) aggregate(z, format(index(z), "%Y-%m"), function(x

Re: [R] subset daily to monthly in a zoo or xts

2012-04-23 Thread Achim Zeileis
On Mon, 23 Apr 2012, Vikram Bahure wrote: Dear R users, I want to subset a daily zoo series according to its month, find % of "NA" in each month. I am finding it difficult to subset the daily dataset into monthly for the given operation.I am planning to do this for a huge dataset. Use aggreg