Dear Community,
the data I receive will be in a data frame:
Var_1 Var_2 Date VaR_3 VaR_4 VaR_5 Var_6
1 4 2010-01-18 7 apple 10 sweet
2 5 2010-07-19 8 orange 11 sour
3 6 2010-01-18 9 kiwi 12 juicy
... ... ... ... ... ... ...
I would like to use zoo, since it seems to be a flexible object class. I'm just starting with R and I tried to read the description (vignettes) for the package.
Questions:
- Given the above data as a data frame, which method is recommended to convert the complete df into a zoo object, telling zoo that it shall use the third column as date column (dates can occur multiple times in the data)?
- How do I aggregate all other columns monthly, except columns 4 and 6 using zoo built-in functions? Is zoo able to automatically discard categorical variables and just use those columns that are suited for aggregation?
- How do I aggregate all numeric columns monthly, for each category in column 4 (column 6 shall not be included, since it is non-numeric).
Thanks for your support.