Displaying 20 results from an estimated 2000 matches similar to: "aggregating data with Zoo"
2007 Feb 22
2
Is there better alternative to this loop?
Dear List,
Thanks to those who helped with my enquiry a few days ago.
I have a another question on loops, in this case I am trying to print out
the row of a data frame if the previous 3 values (daily values) in col5 are
in descending order. I have this loop which works, but ask whether this can
be done differently (without conventional loop) in R:
flag="T"
d= 3 # d represents
2006 Dec 10
1
using zoo for daily stock prices
Hi all,
Please forgive this newbie posting to the list for the first time if I
haven't followed proper procedure. I have read through many of the archives
and find them most useful in learning R.
I have ten years daily data (stock closing prices) which I read in zoo
format. I am having problems coding R to run a count of how many days in
each month have a price higher than the first day
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 May 28
2
Yearly statistics
Dear R-experts,
Sorry if I've overlooked a simple solution here. I have calculated a
proportion of the number of observations which meet a criteria, applied to
five years of data. How can I break down this proportion statistic for each
year?
For example (data in zoo format):
open high low close hc lc
2004-12-29 4135 4135 4106 4116 8 -21
2004-12-30 4120 4131
2007 Mar 02
1
extracting data from zoo series
Dear List,
Sorry if I'm overlooking something simple here but I have gotten a bit
tangled.
I am trying to print the next five values(with their dates), which occur
after a certain condition is met.
I have a series of data in zoo format, call it "A". From this series I have
created a subset (also in zoo format) based on a certain condition, call
this series "B".
I
2007 Jun 08
4
match rows of data frame
Hi R-experts,
I have a data frame (A) , and a subset (B) of this data frame. I am trying
to create a new data frame which gives me all the rows of B, plus the 5th
next row(occuring in A). I have used the below code, but it gives me all 5
rows after the matching row. I only want the 5th.
FiveDaysLater <- A[c(sapply(match(rownames(B),rownames(A)), seq,
length=6))),]
Any guidance much
2007 Feb 22
1
how to show date with this subset
Dear List,
Thankyou to Jim and Marc for their help on my previous question.
I have a data frame of five columns, the first being a list of dates and the
other four columns are numeric values. I wanted to list the days where all 4
columns of values are less than in the previous row. I used the following
which works fine, except it doesnt show the dates for each row (the values
from column 1).
2007 Feb 19
2
help with loop over data frame
Dear List,
This may be the fifth time Ive tried to send this to the list so apologies
if there are multiple emails.
I need some help getting started with this problem. I have a data frame
containing a year of daily stock prices in the following format:
Date Open High Low Close
1/15/2000 10 11 8 10
1/16/2000 12 12 10 11
etc..
I want to create a new
2011 Jan 29
1
Basic Help with Zoo objects and trading days
All,
I have been just recently working with zoo objects for trading systems.
Can someone please help with these basic questions?
Given a daily time series downloaded using get.hist.quote() from the tseries
package, ie......
startDate= as.Date("2000-01-01")
endDate= as.Date("2011-01-29")
frequency= 'd'
s= get.hist.quote('IWF', start= startDate, end=
2012 Feb 28
1
aggregating specific parts in zoo index column to perform sliding average
Here's my code:
http://pastebin.com/0yRxEVtm
The important parts are uncommented and should be easy to find using the
link above. For the following line of code, I plan on looking for a way to
offset it up 7 rows so that the 15 minute timestamp would be considered the
"median" of the subset being averaged to find the mean:
avgCool = aggregate(intCool, trunc(time(intCool),
2006 Oct 28
2
subsetting, aggregating and zoo
Hi,
Having an zoo object I can subset it to obtain the days where I have the
values within some range:
is.zoo(z)
TRUE
subset(z[,1], z[,1]>=5 & z[,1]<= 10) #Yields: Year(day)
1988(13) 1988(14) 1988(16) 1988(20) 1988(21) 1988(22) 1988(25)
1988(26)
7.973946 9.933518 7.978227 7.512960 6.641862 5.667780 5.721358
6.863729
1988(27) 1988(28) 1988(29) 1988(30) 1988(32)
2005 Jun 16
3
Moving average
Good morning all!
I am attempting to superimpose a moving-average smoother onto a graph of
daily plots. These plots (in table[,2] below) span about 350 days and
looks very noisy. I'd like for this smoother to plot the average of each
group of 7 consecutive days (weekly) and show a line which joins these
series of averages. Given the definition of MA, the first and last points
will
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)) ==
2009 Mar 29
1
Data decomposition
Hi R users,
I have a time series variable that is only available at a monthly level for
1 years that I need to decompose to a weekly time series level - can
anyone recommend a R function that I can use to decompose this series?
eg. if month1 = 1200 I would to decompose so that the sum of the weeks for
month1 equals 1200, etc..
Many thanks in advance for any help.
--
View this message in
2008 Jul 23
1
Aggregating zoo object with NAs in multiple column
I would like to run an aggregation on a zoo object that has multiple series
in it, with one of more series having NA values. The problem is that by
default the aggregate function will produce an NA value in each aggregated
period that contains an NA. For instance, if I run aggregate(x,
as.yearmon(index(x)), mean) on the example object "x" which is printed
below, I will just get a bunch
2019 Aug 23
2
Problem with sync user account from Samba Master to Samba Slave
Hello,
i?ve Samba 4.7 with domain controller with 3 servers, 1 master (samba-ad) and two slaves (samba-slave1) and (samba-slave2). The problem is when create user account from "samba-ad? this account not sync to slave, but i create the account on "samba-slave1" or "samba-slave2? this is sync on all server.
Samba version
[???????.]
root at samba-ad:~# samba -V
Version
2014 Feb 13
3
Emne: Eaton Powerware 5110 - some stats not reported
Hi
On
http://nutwiki.kanonbra.com/wiki/Category:Eaton_Powerware_5110
you can see what is reported. The unreleased part refers to v2.7.1, which is now released.
Alf
Greg Vickers <daehenoc at iinet.net.au>:
>Hi all,
>
>I've hooked up an Eaton Powerware 5110 to Ubuntu 13.10 server, and
>configured nut appropriately. The cgi scripts are working fine, but on
2014 Feb 15
0
Emne: Eaton Powerware 5110 - some stats not reported
2014-02-13 6:55 GMT+01:00 Alf H?gemark <alf at i100.no>:
> Hi
>
Hi Alf,
> On
> http://nutwiki.kanonbra.com/wiki/Category:Eaton_Powerware_5110
cool thing!
But duplicating the NUT Device Dumps Library [1].
The DDL can also serve both users and developers purposes, by providing
these dumps as .dev files (usable with dummy-ups).
I'm looking for someone to help me completing
2004 May 16
2
cdr-csv / Zaptel BRI / full number not stored (missing leading zeroes)
Hi,
I'm using a ZaptelBRI card. It works fine.
But I have a small problem with call logs.
The leading zeroes of the external calling party are not stored (e.g. : 0140302010 will be stored as 140302010).
Same for international numbers for which "00" will be stripped out.
I would not mind if the cdr record would give me an indication of the call's origin (national or
2010 Aug 09
1
suggestion for ?factor
Hi Folks.
May I suggest a small addition to ?factor -- this is not explicit
about how to force the ordering of levels in an ordered factor.
One can guess it, but I think it would be a good idea to spell it out.
For example, one can do:
X <- c("Alf","Bert","Chris","Dave")
F <-