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) sum(is.na(x)))
aggregate(z, format(index(z), "%Y-%m"), function(x) sum(is.na(x))/length(x))



Regards,
Enrico

Am 23.04.2012 11:27, schrieb Vikram Bahure:
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.

Thanks in advance.

Regards Vikram



--
Enrico Schumann
Lucerne, Switzerland
http://nmof.net

______________________________________________
R-help@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.

Reply via email to