Displaying 20 results from an estimated 800 matches similar to: "rollmean()"
2008 Jul 11
1
While loop
Hello,
I am trying to loop through a matrix column and find the first value <=0 and
store that matrix location in a variable called Start.
I have tried the following:
i <- 1
j <- 1
while (Matrix[i, j] > 0)
i = (i + 1)
#loop until matrix [i, j] value <= 0
#strore that row number in a variable
Start <- i
I am getting a scripting out of bounds error and I suspect maybe the loop
2008 Jul 15
2
Row Sum, exclude positive values
Hello,
I'd like to sum the values of a row from the first negative number (FN) to
the last negative number (LN), but not add any positive values to the sum.
Then apply this to each row of the data frame.
For example if I have a dataframe with Row 1 values
DF = (4, 3, 2, 1, 0, -1, -2, -3, -2, 2, 1, -1, -2, -3, -2, -1, 1, 2)
I would like to sum the numbers from column 6 to column 16, but not
2008 Jul 23
3
sum each row and output results
Hello,
I have the following data frame (DF):
V5 V5.1 V5.2 V5.3 V5.4 V5.5
2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183
3 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183
4 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183
5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677
2008 Jul 14
2
long data frame selection error
Hello,
I am trying to select the following headers from a data frame but when I try
and run the command it executes halfway through and give me an error at V188
and V359.
Temp <- data.frame(V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15,
V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30,
V31, V32, V33, V34, V35, V36, V37, V38, V39, V40, V41, V42, V43, V44, V45,
2010 Jan 02
1
Question on Reduce + rollmean
Hello useRs,
I'd like to perform a moving average on the dataset, xx. I've tried
combining the functions Reduce and rollmean but it didn't work.
> r <- function(n) rollmean(n, 2) # where 2 = averaging interval
> output < - Reduce("r", x)
Error in f(init, x[[i]]) : unused argument(s) (x[[i]])
Is there anything wrong with the code in the first place?
where
2008 Jul 22
1
rollmean and stl
I need to investigate how rollmean and the trend returned from stl differ.
I am trying to find out exactly what the trend part of stl is (I have just
started coding in R and do not know fortran). I need to extract this
because it will be used in further calculations, and it needs to be verified
to make sure that I am using the right process. I would like to use this
to remove the seasonal
2008 Jul 21
4
how to speed up this for loop?
Could anyone tell me a better way to achieve the output of this for loop? It
seems to run quite slow. I'm sure there must be a more consise way to sum
from FN to LN, excluding positive values, for each row.
#sum between FN and LN, excluding positive values
for(i in 1:R){
for(j in FN[i]:LN[i]){
if(Temp[i,j]<0)
sum[i] <- sum[i] + sum(Temp[i,j])}}
Cheers,
R
--
View this message in
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
2010 Aug 20
3
rollmean help (or similar function)
I am working on a simple pilot project comparing the capability of SQL,
SAS and R to perform a rolling mean per the following instructions. I
have completed the SQL and SAS analysis, so now it's R's turn.
Calculate mean values of x (x=count) for each date in the dataset where
mean = the average count of days [t-9] through day [t-3] for each
date/illness combination.
Dataset aggpilot
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling
sums". (I have seen the Rmetrics package and the rollMean function and I
would like to do the same thing except Sum instead of Mean.) I imagine
someone has done this, I just can't find it anywhere.
Example:
x <- somevector #where x is 'n' entries long
#what I would like to do is:
x1
2010 Jan 04
3
Extract vector elements until cumsum <= x
Hi All,
I have a vector n, and for each n[i] I want to extract n[i], n[i+1],
n[i+2]..., until the cumulative sum of n[i] and subsequent elements exceeds
a CheckValue, whereupon I move to the next index and repeat.
I am trying to find a Vectorized approach, and have seen similar posts where
filter{stat} and rollmean{zoo} were suggested, but, I haven't been able to
figure a way to use them
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
2010 Dec 23
1
Finding flat-topped "peaks" in simple data set
Hello,
Thank you to all those great folks that have helped me in the past
(especially Dennis Murphy).
I have a new challenge. I often generate time-series data sets that look
like the one below, with a variable ("Phase") which has a series of
flat-topped peaks (sample data below with 5 "peaks"). I would like to
calculate the phase value for each peak. It would be great to
2016 Aug 05
4
Fwd: Re: Encrypt /decrypta file with ssh keys.
As per Alex's suggestion, attached is the proof of concept "sfile"
script. If there is anyone out there with great C skills who can
recreate this functionality "out of the box", I think there would be a
few happy campers (at least two, anyways).
-------- Forwarded Message --------
Subject: Re: Encrypt /decrypta file with ssh keys.
Date: Fri, 5 Aug 2016 17:24:35
2009 Jan 28
3
vm ignores kickstart
Hi,
I''m trying to use a kickstart file to install VMs on a Scientific Linux
5.2 (repackaged RHEL52) host, but the install process seems to ignore my
kickstart file. The command I''m using is:
virt-install -n sl4vm01 --ram=1024 --vcpus=1 --os-type=linux
--os-variant=rhel4
--extra-args="ks=http://particle.phys.uvic.ca/~fransham/ks.cfg"
--paravirt --nographics
2017 Sep 01
2
Area bajo la curva
Estimado Wilmer Contreras Sepulveda
Me parece buena la sugerencia de Jorge, hay muchas formas, yo aparte de la sugerencia que le hicieron le agrego otras dos, en cualquier buscador las palabras claves son R AUC, y el artículo https://www.r-bloggers.com/calculating-auc-the-area-under-a-roc-curve/ , lógicamente aparecerán tantas alternativas que puede llegar a confundirse respecto a cuál es
2004 Nov 04
1
Allow access to a share to all members of a container?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have 104,000 users, some of which are in the OU:
ad.network.local\AD\People\IFAS\Hort
Is there an easy way to find all the users in this OU and grant them
access to a share?
Or do I have to list each user individually?
And if so, can I use net user to list the users in an OU?
- -Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6
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.