similar to: Zoo - bug ???

Displaying 20 results from an estimated 1000 matches similar to: "Zoo - bug ???"

2011 Aug 12
2
rollapply.zoo() with na.rm=TRUE
Hi. I'm comparing output from rollapply.zoo, as produced by two versions of R and package zoo. I'm illustrating with an example from a R-help posting 'Zoo - bug ???' dated 2010-07-13. My question is not about the first version, or the questions raised in that posting, because the behaviour is as documented. I'm puzzled as to why na.rm no longer is passed to mean, i.e. why
2012 Jul 16
1
problem with installing R pacakges
Dear R- Users, I am unable to install R packages over the internet. Below is my session information. My guess is that this may be a proxy issue. I have set the http_proxy_user : my user id(network id) : password (machine password) . The error I get is as below > install.packages("MASS") Warning: unable to access index for repository
2011 Apr 03
1
zoo:rollapply by multiple grouping factors
# Hi there, # I am trying to apply a function over a moving-window for a large number of multivariate time-series that are grouped in a nested set of factors. I have spent a few days searching for solutions with no luck, so any suggestions are much appreciated. # The data I have are for the abundance dynamics of multiple species observed in multiple fixed plots at multiple sites. (I total I
2012 Jan 24
1
problems with rollapply {zoo}
Here is a relatively simple script (with comments as to the logic interspersed): # Some of these libraries are probably not needed here, but leaving them in place harms nothing: library(tseries) library(xts) library(quantmod) library(fGarch) library(fTrading) library(ggplot2) # Set the working directory, where the data file is located, and read the raw data
2009 Mar 23
1
performance: zoo's rollapply() vs inline
zoo's rollapply() function appears to be extremely useful for plugging in a function on-the-fly to run over a window. With inline, there is a lot more coding and room for error, and the code is less portable because the user has to have R compiling set up or it won't work. However, rollapply() seems to be really slow. Several orders of magnitude slower than inline, in fact. I don't
2009 Nov 27
2
How to compute Rolling analysis of Standard Deviation using ZOO package?
Hello: I want to get a rolling estimation of the stdev of my data. Searching the document, I found the function "rollapply" in the zoo package. For example, my series is "c", and i want get a period of 10 days, so i write the command below: roll.sd = rollapply( c, 10, sd, na.pad = TRUE, align = 'right' ) but there is an error in it ,and the computing cannot be
2008 Aug 21
1
max and min with the indexes in a zoo object (or anything else that could solve the problem)
library(zoo) library(chron) t1 <- chron("1/1/2006", "00:00:00") t2 <- chron("1/31/2006", "23:45:00") deltat <- times("00:15:00") tt <- seq(t1, t2, by = times("00:15:00")) d <- sample(33:700, 2976, replace=TRUE) sin.zoo <- zoo(d,tt) #there are ninety six reading in a day d.max <- rollapply(sin.zoo, width=96, FUN=max)
2011 Nov 04
1
zoo performance regression noticed (1.6-5 is faster...)
Good morning, I have discovered what I believe to be a performance regression between Zoo 1.6x and Zoo 1.7-6 in the application of rollapply. On zoo 1.6x, rollapply of my function over my data takes about 20 minutes. Using 1.7-6, the same code takes about 6 hours. R --version R version 2.13.1 (2011-07-08) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform:
2007 Nov 30
1
rollapply on zoo object
Dear R users. I have zoo object "size_june" containing market-capital values: > dim(size_june) # market-cap data of 625 firms for 20 years [1] 20 625 > class(size_june) [1] "zoo" > size_june # colnames = "size.firmcode" size.34020 size.4710 size.11050 size.10660 size.9540 size.8060 size.16160 size.8080 size.9280 1988-06-30 NA
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
Bill, I have clarified this on SO, and I will copy that clarification in here: "Sure, we tested them on other 8-digit numbers as well & we could not replicate. However, these are honest-to-goodness numbers generated by a non-adversarial system that has no conception of these numbers being used for anything other than a unique key for an entity -- these are not a specially constructed
2010 Jan 13
1
Rollapply
Hi I would like to understand how to extend the function (FUN) I am using in rollapply below. ###################################### With the following simplified data, test1 yields parameters for a rolling regression data = data.frame(Xvar=c(70.67,70.54,69.87,69.51,70.69,72.66,72.65,73.36), Yvar =c(78.01,77.07,77.35,76.72,77.49,78.70,77.78,79.58)) data.z = zoo(d) test1 =
2010 Nov 04
3
postForm() in RCurl and library RHTMLForms
Hi RUsers, Suppose I want to see the data on the website url <- "http://www.nseindia.com/content/indices/ind_histvalues.htm" for the index "S&P CNX NIFTY" for dates "FromDate"="01-11-2010","ToDate"="02-11-2010" then read the html table from the page using readHTMLtable() I am using this code webpage <-
2008 Jul 31
1
rollapply() to portions of a matrix
Hi everyone, I have a rollapply statement that applies a function, in steps, over a data matrix as follows: #Code start testm<-rollapply(mat, 100, by=100, min, na.rm=F) #Code end This moves down matrix 'mat' and calculates the minimum value over a 100 row range, every 100 rows (i.e. no overlaps). NAs are not removed. I want to modify this statement somehow so that the rollapply()
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
Bill, Appreciate the point that both you and Serguei are making, but the sequence in question is not a selected or filtered set. These are values as observed in a sequence from a mechanism described below. The probabilities required to generate this exact sequence in the wild seem staggering to me. T On Fri, Nov 3, 2017 at 11:27 PM, William Dunlap <wdunlap at tibco.com> wrote: >
2010 Apr 09
3
"fill in" values between rollapply
Hi, Sorry ahead of time for not including data with this question. Using rollapply to calculate mean values for 5 day blocks, I'd use this: Roll5mean <- rollapply(data, 5, mean, by=5, align = c("left")) My question is, can someone tell me how to fill in the days between each of these means with the previously calculated mean? If this doesn't make sense, I will clarify and
2017 Aug 10
2
Zoo rolling window with increasing window size
Hi again, I am wondering there is any function for 'zoo' time series, where I can apply a user defined function rolling window basis, wherein window size is ever increasing i.e. not fixed. For example, let say I have below user defined function and a zoo time series : > library(zoo) > UDF = function(x) sum(x) > TS = zoo(rnorm(10), seq(as.Date('2017-01-01'),
2013 Jun 27
3
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum? #I am tryign to use rollapply to calcualte a moving sum? #I tried rollapply and get the error message #"Error in seq.default(start.at, NROW(data), by = by) : # wrong sign in 'by' argument" #example: mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20) ) mymatrix_cumsum <- ( matrix(data=NA, nrow=5,
2011 Dec 02
2
Moving column averaging
# need zoo to use rollapply() # your data (I called df) df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", "e", "f"), class = "data.frame", row.names = c(NA, -2L)) # transpose and make a zoo object df2 <- zoo(t(df)) #rollapply to get
2010 May 10
3
scope of a function + lazy evaluation
Hey guys, I have a doubt here , It is something simple I guess, what am I missing out here ?? f <- function(y) function() y tmp <- vector("list", 5) for (i in 1:5) tmp[[i]] <- f(i) tmp[[1]]() # returns 5; z <- f(6) tmp[[1]]() # still returns 5; it should return 6 "ideally" right ??? Even if I dont evaluate the function tmp[[1]] before i.e I do rm(list=ls()) f
2017 Nov 03
5
Extreme bunching of random values from runif with Mersenne-Twister seed
This is cross-posted from SO (https://stackoverflow.com/q/47079702/1414455), but I now feel that this needs someone from R-Devel to help understand why this is happening. We are facing a weird situation in our code when using R's [`runif`][1] and setting seed with `set.seed` with the `kind = NULL` option (which resolves, unless I am mistaken, to `kind = "default"`; the default being