Displaying 20 results from an estimated 10000 matches similar to: "aggregate.zoo"
2009 Feb 17
2
annual maximum value
hi everyone!
hope you can help me here.
i am a new R user. what i am trying to do is to find the maximum annual
discharge from a daily record. i have a data.frame which includes date and
the discharge. somewhat like this..
10/1/1989 2410
10/2/1989 2460
10/3/1989 2890
...
...
...
12/31/2005 5730
i have been browsing through the archives and fount out about the aggregate
2008 Jan 14
1
zoo object
I have an ordered series of 3 month t-bill rates (annual). I transform
this to a daily series, however, the observations are constructed only
from the dates on which the t-bills were issued, which is every week.
So now I have ordered observations of the daily 'risk-free rate' for
one day every week. I want to expand this zoo object to give a value
for every day, and to do so, copy the
2017 Oct 06
2
Time series: xts/zoo object at annual (yearly) frequency
Hi,
I'd like to make a time series at an annual frequency.
> a<-xts(x=c(2,4,5), order.by=c("1991","1992","1993"))
Error in xts(x = c(2, 4, 5), order.by = c("1991", "1992", "1993")) :
order.by requires an appropriate time-based object
> a<-xts(x=c(2,4,5), order.by=1991:1993)
Error in xts(x = c(2, 4, 5), order.by =
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have
found an odd problem, that seems to be caused by zoo()'s handling of leap
years.
Here's my R script with 2 methods (freq=365, 366) for aggregating the daily
data to monthly series:
library(zoo)
J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv"
JAXA_data <- read.table(J_link,
2012 May 09
4
Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.
I have spent hours on R in Windows 7. Just installed 2 days ago so the R
package should be current.
Currently I am using the RGui (64-bit) for Windows.
I can not read an Excel file into R from my computer. Have hours on this.
Completely crazy!!
I have the XLConnect package loaded. I think it is loaded because when I
enter:
> loadedNamespaces()
[1] "base"
2011 Aug 08
1
aggregate.zoo on bivariate data
Hi,
I'm removing non-unique time indices in a zoo time series by means of
aggregate. The time series is bivariate, and the row to be kept only depends
on the maximum of one of the two columns. Here's an example:
x <- zoo(rbind( c(1,1), c(1.1, 0.9), c(1.1, 1.1), c(1,1) ),
order.by=c(1,1,2,2))
The eventual aggregated result should be
1 1.1 0.9
2 1.1 1.1
that is, in
2013 Mar 08
2
Zoo Data
Hi Jakob,
dat1<-read.table(text="
TIME, Value1, Value2
01.08.2011 02:30:00, 4.4, 4.7
01.09.2011 03:00:00, 4.2, 4.3
01.11.2011 01:00:00, 3.5, 4.3
01.12.2011 01:40:00, 3.4, 4.5
01.01.2012 02:00:00, 4.8, 5.3
01.02.2012 02:30:00, 4.9, 5.2
01.08.2012 02:30:00, 4.1, 4.7
01.12.2012 03:00:00, 4.7, 4.3
01.01.2013 01:00:00, 3, 4.3
01.01.2013 01:30:00, 3.8, 4.1
01.01.2013 02:00:00, 3.8,
2010 Jan 29
1
use zoo package with multiple column data sets
Readers,
I am trying to use the zoo package with an array of data:
file1:
hh:mm:ss 1
hh:mm:ss 2
hh:mm:ss 3
hh:mm:ss 4
file2:
hh:mm:ss 11 55
hh:mm:ss 22 66
hh:mm:ss 33 77
hh:mm:ss 44 88
I wanted to merge these data set so I tried the following commands:
library(chron)
library(zoo)
z1<-read.zoo("path/to/file1.csv",header=TRUE,sep=",",FUN=times)
2012 Jul 02
2
using "na.locf" from package zoo to fill NA gaps
Hi everybody,
I have a small question about the function "na.locf" from the package "zoo".
I saw in the help that this function is able to fill NA gaps with the last
value before the NA gap (or with the next value).
But it is possible to fill my NA gaps according to the last AND the next
value at the same time?
Actually, I want R to fill my gaps with the method of
2009 Jul 01
1
A problem on zoo object
I have a zoo object on daily data for 10 years. Now I want to create a list,
wherein each member of that list is the monthly observations. For example,
1st member of list contains daily observation of 1st month, 2nd member
contains daily observation of 2nd month etc.
Then for a particular month, I want to divide all observations into 3 parts
(arbitrary) and then want to calculate some statistics
2010 Mar 07
3
aggregate for zoo or its?
Dear R People:
The aggregate function works very well on regular time series.
Is there a version for zoo or its that would take daily data and
convert it to monthly, please?
Thanks in advance,
Sincerely,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com
2010 Aug 01
1
aggregating a daily zoo object to a weekly zoo object
Dear R People:
I'm trying to convert a daily zoo object to a weekly zoo object:
xdate <- seq(as.Date("2002-01-01"),as.Date("2010-07-10"),by="day")
library(zoo)
length(xdate)
xt <- zoo(rnorm(3113),order=xdate)
xdat2 <- seq(index(xt)[1],index(xt)[3113],by="week")
xt.w <- aggregate(xt,by=xdat2,mean)
Error: length(time(x)) ==
2012 Mar 25
1
Struggling with zoo and aggregate
All:
I have a SQlite database where I have stored some verification data by date
& time (cycle Z/UTC), lead_time as well as type, duration, etc. I would
like to analyze & plot the data as monthly averages. I have looked at a
bunch of examples which use some combination of zoo and aggregate, but I
have not been able to successfully apply bits and pieces from the examples
I have found. Any
2010 Apr 12
1
N'th of month working day problem
Dear Gabor,
Thanks for your reply. however:
> tail(DJd)
^DJI.Close
2010-04-01 10927.07
2010-04-05 10973.55
2010-04-06 10969.99
2010-04-07 10897.52
2010-04-08 10927.07
*2010-04-09 10997.35*
> tail(ag)
2009-11-30 10344.84
2009-12-31 10428.05
2010-01-31 10067.33
2010-02-28 10325.26
2010-03-31 10856.63
*2010-04-30 10997.35
*
It seems the script "makes up"
2009 Sep 27
2
zoo: merging aggregated zoo-objects fails
Dear all,
I have several text files looking like this:
9063032 19700201 22:00 174.067
9063032 19700201 23:00 174.076
9063032 19700202 00:00 174.085
9063032 19700202 01:00 174.091
9063032 19700202 02:00 174.094
9063032 19700202 03:00 174.091
9063032 19700202 04:00 174.082
9063032 19700202 05:00 174.079
And I run this loop:
for (j in 1:nr.of.files)
{
#Import:
DF <-
2006 Dec 27
5
plotting time series with zoo pckg
Hi all,
I am using the zoo package to plot time series. I have a problem with formatting the axes.
my zoo object (z) looks like the following.
c1
1992-01-10 21
1992-01-17 34
1992-01-24 33
1992-01-31 41
1992-02-07 39
1992-02-14 38
1992-02-21 37
1992-02-28 28
1992-03-06 33
1992-03-13 40
2010 Feb 22
1
lmom: plotting log Pearson Type III
Can anyone show me how to add a log Pearson type III plot using the
evdistq() command to an extreme value plot using the lmom package?
Attached sample code below...
Thanks in advance,
Dave
library(lmom)
# annual maximum daily streamflows Mackenzie River
mackenzieRiver = c(26600, 30300, 34000, 32000, 29200, 28300, 28600,
26400, 28300, 28800, 29000, 22100, 32900, 31800, 21600, 32100, 27000,
2010 May 12
2
How to extract sum of particular months in a monthly data series
Dear Users,
I have a monthly data for a number of years(1960-2007) for a number of
stations and i wish to extract sesonal time-series for the months of
March-May and October-November for very station. I have read this data with
read.table in R with stations as columns and time (months) as rows. My
attempt to aggregate with the zoo package using the function as.yearqtr
failed since this sums
2007 Jun 01
1
aggregate in zoo
Hi R-experts,
Thanks very much to Jim Holtman and Gabor on my previous question.
I am having another problem with data manipulation in zoo. The following is
data (Z) for first business day of every month in zoo format. I am trying to
get mean of "open" for each year. I subset Z <- Z[,2] then
> sapply(split(Z, format(index(Z), "%Y")),mean)
I get error message:
2007 Nov 17
2
Getting Annual (Conditional) Averages
Hello,
I'm very new to R, and so my question is simple.
I have data record with 80 years of daily temperatures in one long
string. The dates are also recorded, in YYMMDD format. I'd like to
learn an elegant simple way to pull out the annual averages.
(Obviously, every 4th year has 366 days.)
I know I can set up a formal loop to create annual records and then
average. But R