Questions tagged [zoo]

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

zoo ("Z's Ordered Observations") is an package for analysis of regular and irregular time series.

It provides an class with methods for totally ordered indexed observations. It is particularly aimed at irregular of numeric vectors/matrices and factors. zoo's key design goals are independence of a particular index/date/time class and consistency with ts in base-R by providing methods to extend standard generics.

Repositories

Vignettes

Other resources

Related tags

1328 questions
-1
votes
1 answer

calculating differences in times, data grouped by rows

I have a data set in the following format ID DATETIME VALUE 1 4/2/2012 10:00 300 1 5/2/2012 23:00 150 1 6/3/2012 10:00 650 2 1/2/2012 10:00 450 2 2/2/2012 13:00 240 3 6/5/2012 09:00 …
Matthew
  • 19
  • 1
-1
votes
1 answer

Subsetting seconds in xts/zoo

Is there a possiblity to subset seconds in xts? 2013-01-01 00:01:00 2.2560000 2013-01-01 00:02:00 2.3883333 2013-01-01 00:03:00 1.8450000 2013-01-01 00:04:00 1.6966667 2013-01-01 00:04:03 1.3100000 2013-01-01 00:05:00 0.8533333 I want to get the…
Herr Student
  • 853
  • 14
  • 26
-1
votes
1 answer

select time series data by month

I have time series data that appears like below: data Jan Feb Mar Apr May Jun Jul Aug Sep 1960 -10.3000 -7.1000 2.9000 18.0000 18.9000 29.5000 31.4000 28.0000 20.7000 1961 -1.8000 …
-1
votes
2 answers

zoo object cannot contain both factor and numeric vectors

I was reading the zoo FAQs, and came across something that I found surprising. A "zoo" object may be (1) a numeric vector, (2) a numeric matrix or (3) a factor but may not contain both a numeric vector and factor. Is it unreasonable to expect…
tchakravarty
  • 10,736
  • 12
  • 72
  • 116
-2
votes
3 answers

zoo::rollapply window with over column values rather than rows

dat = structure(list(index = c(10505L, 10506L, 10511L, 10539L, 10542L, 10579L, 10642L, 11008L, 11012L, 13011L, 13110L, 13116L, 13118L, 13156L, 13259L, 13273L, 13313L, 13365L, 13380L, 13382L, 13445L, 13453L, 13482L, 13483L, 13494L, 13543L, 13550L,…
user438383
  • 5,716
  • 8
  • 28
  • 43
-2
votes
1 answer

How would you create a summary zoo from a list of files?

Suppose I have a number of csv files that have the following format: Date,col1,col2,col3 8/1/2017,2,3,4 8/5/2017,4,6,7 Date,col1,col2,col3 8/1/2017,2,3,4 8/3/2017,2,5,4 8/5/2017,4,6,7 How would I create a 1 zoo object that for each date shows me a…
Denis
  • 11,796
  • 16
  • 88
  • 150
-2
votes
3 answers

R - Split time series into colums depending on weekday

I have the below time series, showing 15minutes stamps of electricity Load for the whole year of 2017: -Datum & Zeit` kWh Sun Jan-01-2017 01:45 374.420 Sun Jan-01-2017 02:00 355.040 Sun Jan-01-2017 02:15 359.995 Sun Jan-01-2017…
Solar
  • 1
  • 2
-2
votes
3 answers

Yahoo financial data in r with zoo

Hello i want to import a . csv file in r, i have the following code : fbmonthly<-read.zoo("E:\\R\\Stockforecast\\Data\\AAPLmonthly.csv",sep=",",header= TRUE, format = '%m/%Y', FUN=as.Date) Although i have this error : Error in…
-2
votes
2 answers

Rollmean based on conditions

Based on the dataframe below, I would like to create a new column using rollmean based on three conditions - the values in column b match each other, the minimum values to be averaged in column a is 2, and I only want to average all values below the…
Dan L
  • 57
  • 5
-2
votes
1 answer

Filtering dataframes by dates for zoo breakpoints

I have the following CSV file: f , c 1,19/11/2014 12:00,0.01 2,19/11/2014 13:00,0.01 3,20/11/2014 15:00,0.01 4,20/11/2014 16:00,0.01 5,20/11/2014 17:00,0.01 6,20/11/2014…
Avi
  • 2,247
  • 4
  • 30
  • 52
-2
votes
3 answers

How to efficiently do complex row operations with nested functions in R?

Given a multidimensional array, e.g. a zoo object z, with columns a,b,c,x. Given further a function W(w=c(1,1,1), x) which for example weights every column individually, but which also DEPENDS on the specific row value in column x. How to…
Martin
  • 1,395
  • 1
  • 11
  • 33
-2
votes
1 answer

How do i subset a zoo object based on values for a particular month

My zoo object I Would like to create a subset of values (these are discharge values) containing only December flow values. Thank you!
Fashraf
  • 21
  • 3
-2
votes
1 answer

Time series data frame in R

Currently, I have a data frame (A) with row.names as dates and two column values (Xval and Yval) Xval,Yval "2015-01-01",5,6 "2015-01-02",7,4 "2015-01-05",-1,10 "2015-01-06",-4,3 I have two main questions: (Question 1) I want to compute a new data…
qwer
  • 223
  • 4
  • 13
-2
votes
2 answers

How do I combine the first two columns and convert the data into xts format so I can analyse the time series?

Date Timestamp Open High Low Close Volume 1 20131020 22:00:00 1.61730 1.61730 1.61727 1.61727 0.30 2 20131020 22:01:00 1.61722 1.61727 1.61686 1.61686 23.28 3 20131020 22:02:00 1.61682 1.61707 1.61670 1.61698…
-2
votes
1 answer

Write ZOO (XTS) object into CSV file by separating index column into two columns

I have 2-column (index and value) ZOO object, where index contains date and time values: 2010-02-18 13:11:00 48.090 2010-02-18 13:12:00 48.110 2010-02-18 13:13:00 48.100 I want to save this ZOO object into CSV by separating index column into two…
Eldar Agalarov
  • 4,849
  • 4
  • 30
  • 38
1 2 3
88
89