Displaying 20 results from an estimated 2000 matches similar to: "Moving average"
2009 Dec 10
1
Moving Averages in ggplot2
Hello all,
Have some time series data stored in a data.frame, and am plotting it with
ggplot2 (which is totally awesome). I have explored the documentation and
mailing list archives, and I can't see any way to plot a 'smoother' that is
just the K-step moving average.
For example, imagine I had a data.frame called 'sleep' with 'date' as the
date (from as.Date()) and
2008 Jan 07
5
moving or running average
Hi all R users,
Can anyone please let me know how to do the moving average with R?
With regards,
Abu
_________________________________________________________________
Free games, great prizes - get gaming at Gamesbox.
2006 Oct 12
3
ts vs zoo
> Hello,
>
> I have lots of data in zoo format and would like to do some time
> series analysis. (using library(zoo), library(ts) )
>
> My data is usually from one year, and I try for example stl() to find
> some seasonalities or trends.
>
> I have now accepted, that I might have to convert my series into ts()
> but still I am not able to execute the comand since
2011 Jun 25
1
Moving average in a data table
Hi,
I'm trying to figure out common approach on calculating MA on a dataset
that contains column "time".
After digging around, I believe functions rollmean and rollaply should
be used.
However I don't quite understand the requirements for the underlying data.
Should it be zoo object type? Formatted in a special way?
As an example, I'm looking to get calculated
2009 Feb 26
3
Moving Average
I am looking for some help at removing low-frequency components from a signal, through Moving Average on a sliding window.
I understand thiis is a smoothing procedure that I never done in my life before .. sigh.
I searched R archives and found "rollmean", "MovingAverages {TTR}", "SymmetricMA".
None of the above mantioned functions seems to accept the smoothing
2011 Mar 22
3
Accelerating the calculation of the moving average
Dear List,
I have a data frame with approximately 500000 rows that looks like this:
?Date??? time??? value
?
19.07.1956????????? 12:00:00?????????????? 4.84
19.07.1956????????? 13:00:00?????????????? 4.85
19.07.1956????????? 14:00:00?????????????? 4.89
19.07.1956????????? 15:00:00?????????????? 4.94
19.07.1956????????? 16:00:00?????????????? 4.99
19.07.1956????????? 17:00:00?????????????? 5.01
2009 Jul 23
1
dimension trouble for a matrix
Dear R People:
I'm having trouble with something that should be very simple.
I'm setting up a matrix outside of a loop and writing items into it
during the loop.
Here is the output:
> glob3b("sites.info")
dim 27 3
[1] "/raid1/osg-app"
Error in xy[i, ] : incorrect number of dimensions
Here is the function:
> glob3b
function(xx) {
x.df <-
2005 Jun 23
3
(no subject)
Hello Rers:
Let's say I have a column that looks like this:
Column
167.8
292.8
363.3
1.9
115.25
I want to manipulate the above data such that I only end up with this same
column but only with its decimals and not its whole numbers. So the new
column would look like this (but the real column is VERY long):
Column
.8
.8
.3
.9
.25
Any suggestions about how I could do this?
--
Do all you
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=
2010 Nov 16
2
Computing Rolling Average
Hi,
Can anyone suggest a clever way to compute a rolling weekly average of the
columns in a matrix? The column bit is straightforward – use apply given a
function which does what you want on a column. With regard to a particular
column, the obvious way is to run a for loop indexing the last 7 days and
computing the average . I simply would like to know if there is a better /
quicker way.
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2006 Mar 28
1
trellis graph question
R2.2, WinXP:
I am using xyplot( ) to generate time plots of plasma concentration data.
The following is an edited version of my code:
xyplot(log.conc ~ time| group, data = foo,
groups = subject,
panel = function(x, y, panel.number, ...)
{
panel.superpose(x, y,
subscripts = TRUE,
groups = foo$group,
type = 'l', col
2008 Feb 07
2
a kinder view of Type III SS
A young colleague (Matthew Keller) who is an ardent fan of R is teaching me
much about R and discussions surrounding its use. He recently showed me
some of the sometimes heated discussions about Type I and Type III errors
that have taken place over the years on this listserve. I'm presumptive
enough to believe I might add a little clarity. I write this from the
perspective of someone old
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
2007 Mar 28
2
aggregating data with Zoo
Is there a way of aggregating 'zoo' daily data according to day of week? eg
all Thursdays
I came across the 'nextfri' function in the documentation but am unsure how
to change this so any day of week can be aggregated.
I have used POSIX to arrange the data (not as 'zoo' series) according to day
of week, but am curious if I've missed if a similar option available
2006 Mar 15
1
(newbie) Weighted qqplot?
Folks,
Normally, in a data frame, one observation counts as one observation
of the distribution. Thus one can easily produce a CDF and (in Splus
atleast) use cdf.compare to compare the CDF (BTW: what is the R
equivalent of the SPlus cdf.compare() function, if any?)
However, if each point should not count equally, how can I weight the
points before comparing the distributions? I was thinking of
2008 Jul 09
2
rollmean()
Hello,
I am trying to calculate a 31 day running mean in some temperature data
along ROWS. Rollmean() works great along columns, but how do I perform this
same action on my rows?
The data is a matrix of 365 columns (days of the year) by 5,000 rows
(lat/long coordinates).
I would like to perform a 31 day running mean along the 365 days.
I am new to R so any help would be greatly appreciated!
2017 Nov 24
2
number to volume weighted distribution
Hi Duncan
I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably).
Ecdf(x, q=.5)
Ecdf(x, weights=xw,col=2, add=T, q=.5)
wtd.quantile(x)
0% 25% 50% 75% 100%
10 10 10 100 300
wtd.quantile(x, weights=xw, type="i/n")
0% 25% 50% 75% 100%
10.0000 138.8667 192.5778 246.2889 300.0000
But could you please be more specific in this?
>
2017 Nov 24
0
number to volume weighted distribution
On 24/11/2017 6:27 AM, PIKAL Petr wrote:
> Dear all
>
> Strictly speaking it is not R question but as you are the most capable persons I know I give it a try.
>
> I am strugling with recalculation of number weighted to volume weighted distribution.
>
> Suppose I have objects (cubes) with size
>
> x<- c(rep(10,20), rep(100, 10), rep(300,5))
> I can get
>