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
4 answers

Calculating time difference between rows in days

I'm trying to calculate the difference in days of my rows to create interval. My data set called temp looks like this, ID Event 31933 11/12/2016 31933 11/14/2016 31750 09/04/2016 31750 09/10/2016 31750 09/30/2016 31750 10/01/2016 30995 …
Jenny
  • 29
  • 2
-1
votes
1 answer

Is there any license requirement using mxnet model zoo?

I think Models listed on https://mxnet.incubator.apache.org/model_zoo/ is free to use as basis of fine tuning. Am I right? Is there any license problem or condition using these models (VGG16,ResidualNet152,etc)
Yasu
  • 1
  • 1
-1
votes
1 answer

Using xts or zoo to find faster and accurate Time differences in R

I'm looking to find faster and more accurate methods to find the difference between two times, preferably using the xts or zoo packages. At the moment I would like to find the number of milliseconds difference between two times, and to do this I…
-1
votes
1 answer

zoo and tapply for seasonal mean for variables by town

wood is my dataframe town date prec TP TC TR 1/10/1983 NaN NaN 11.34 CR 2/12/1983 NaN NaN 4.3 TR 3/12/1983 11.22 11.36 NAN SP 5/6/1985 NaN NaN 3.2 BM 6/7/1994 6.33 6.23 1.2 BM …
Wis786
  • 53
  • 8
-1
votes
2 answers

Converting a factor time variable to yearmon variable

I have a data-frame which looks as follows, head(elnino) YEAR..MONTH NINO.3 NINO.3.4 rainfall 1 1950 Jan -1.28 -1.34 5.8 2 1950 Feb -1.10 -1.25 17.8 3 1950 Mar -0.92 -1.16 …
AKS
  • 11
  • 5
-1
votes
1 answer

List of Lists to a merged matrix

Sorry for asking a what may seem to you guys a very basic question on something I am trying to do in R. My data is a list of lists. dataset $Series1 date Value 2015-11-01 1.301 2015-11-02 6.016 2015-11-03 4.871 2015-11-04 10.925 2015-11-05…
-1
votes
2 answers

R - Fast way to calculate rolling mean with varying width

I have a dataframe that contains bank assets for several dates (times). Each bank has a unique ID: # Sample Data time <- c(51, 52, 53, 55, 56, 51, 52, 51, 52, 53) id <- c(1234, 1234, 1234, 1234, 1234, 2345, 2345, 3456, 3456, 3456) name <- c("BANK…
jb123
  • 197
  • 2
  • 12
-1
votes
2 answers

convert hourly data into timeseries in r

I have data of each hour of approximately 3 years, i am working on how to convert it into time series can u pleas help me out head(hourly) Date...Hour.Block hour A1 A2 E1 E2 N1 N2 1 01-01-2015 00 - 01…
-1
votes
1 answer

Time series and fitted values side by side in one time series / data frame / graph

I am using dlnm and lm to fit a linear model of a number of time series. I would like to visually compare the fitted values with the actual values, and so I want to export both in one csv file. However, it appears that I cannot use ts.intersect to…
oulenz
  • 1,199
  • 1
  • 15
  • 24
-1
votes
2 answers

How to convert matrix with tick data into xts?

I have the data which i am trying to convert into xts format: > dput(data) structure(list(50370788L, 50370777L, 50370694L, 50370620L, 50370504L, 620639L, 620639L, 592639L, 592639L, 592639L, "2015-10-24", "2015-10-24", "2015-09-04",…
Alex Bădoi
  • 830
  • 2
  • 9
  • 24
-1
votes
1 answer

Quantifying Logged Non-activity in R-- Overlapping logged events

Update: This seems to be very well-described in SQL forums -- how to account for the gaps in-between time ranges (many of which overlap.) So I may have to turn to SQL to quickly solve this problem, but I'm surprised it cannot be done in "R". It…
lorange
  • 1
  • 3
-1
votes
1 answer

Installing Zoo for R seems to be successful, but gives `Error object 'zoo' not found

I don't seem to be able to install the zoo library. I've installed ggplot2, xts, and a lot of other libraries. Zoo is the first one to throw an error. How can the following happen? > install.packages("zoo") trying URL…
Don P
  • 60,113
  • 114
  • 300
  • 432
-1
votes
1 answer

r zoo object: different fill for different columns

I have two zoo objects in r, a1 and a2, that I want to merge, then fill in missing values. I want to fill the missing values of a1 with na.approx(), and i want to fill the missing values of a2 with na.locf(). How can I accomplish this? an…
RyanStochastic
  • 3,963
  • 5
  • 17
  • 24
-1
votes
1 answer

Create xts index with both date & time

I want to run some 1 minute data I get from a trading app through an R program I've written. So far all of my xts objects have just been daily bars from Yahoo, etc. How do I create the time part of the xts index? Note that Date & Time are in the…
LGTrader
  • 2,349
  • 4
  • 23
  • 29
-1
votes
1 answer

Using the 'zoo package' in R to sum data for a month

I've got some data in the following format in the R studio workspace: Date Value 2013-10-01 0:05:00 4.34 2013-10-01 0:10:00 3.04 2013-10-01 0:15:00 4.56 2013-10-01 0:20:00 5.00 ...... ...... ...... ...... 2013-10-02…