Top "Zoo" questions

zoo is an R package that provides an S3 class with methods for totally ordered indexed observations.

Extract month and year from a zoo::yearmon object

I have a yearmon object: require(zoo) date1 <- as.yearmon("Mar 2012", "%b %Y") class(date1) # [1] "yearmon" How can …

r date zoo
Converting year and month ("yyyy-mm" format) to a date?

I have a dataset that looks like this: Month count 2009-01 12 2009-02 310 2009-03 2379 2009-04 234 2009-05 14 2009-08 1 2009-09 34 2009-10 2386 I want …

r date posix zoo r-faq
R not finding package even after package installation

I have always worked with the zoo package, that I have installed a long time ago. Today, I created a …

r installation package zoo
Replacing NAs with latest non-NA value

In a data.frame (or data.table), I would like to "fill forward" NAs with the closest previous non-NA value. …

r data.table zoo r-faq
Basic lag in R vector/dataframe

Will most likely expose that I am new to R, but in SPSS, running lags is very easy. Obviously this …

r time-series xts zoo
Replace -inf, NaN and NA values with zero in a dataset in R

I am trying to run some trading strategies in R. I have downloaded some stock prices and calculated returns. The …

r time-series nan zoo
Error in ggplot.data.frame : Mapping should be created with aes or aes_string

I am having a trouble while extracting the path from a ggplot and am stuck with an error. The image …

r ggplot2 dplyr zoo
Reading csv with date and time

I am working in R and reading csv which has date and time in its first column. I want to …

r xts zoo
Convert daily to weekly/monthly data with R

I have daily prices series over a wide range of products; I want to convert to a new dataframe with …

r xts zoo quantmod
Moving average of previous three values in R

In the zoo package there is a function called rollmean, which enables you to make moving averages. The rollmean(x,3) …

r zoo moving-average