Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
zooRIでは、次のようなものを使用して、月ごとに日次データを頻繁に集計します。
zoo
result <- aggregate(x, as.yearmon, "mean", na.rm=TRUE)
週ごとにこれを行う方法はありますか?
最も簡単な方法は、 のapply.weekly関数を使用することxtsです。
apply.weekly
xts
> apply.weekly(zoo(1:10, as.Date("2010-01-01") + 1:10), mean) 2010-01-03 2010-01-10 2010-01-11 3 42 10