similar to: Vector recycling and zoo

Displaying 20 results from an estimated 10000 matches similar to: "Vector recycling and zoo"

2009 Oct 15
2
How to right-align labels in dotchart
I have only just discovered the joys of the dotchart (since I am reading William Cleveland's -- Sean Carmody The Stubborn Mule http://www.stubbornmule.net http://twitter.com/seancarmody [[alternative HTML version deleted]]
2009 Jul 27
2
Draw plot.table axis on right hand side
With an ordinary plot, to customise the axis it is possible to suppress drawing the axis and then call Axis. I have been trying to change the location of the y-axis on a plot.table plot to the right hand side, but cannot even work out how to suppress drawing the labels. Here is a toy example of the sort of plot I am working with. Any suggestions as to how to have the axis on the right hand side
2009 Jul 03
1
Plot Fonts in Windows vs Mac OSX
I have been plotting the same charts using png on a Windows machine and on a Mac OSX and the quality of the resulting images, particularly in relation to the fonts, look far superior in the plots produced on the Mac. Is there any way I can enhance the quality of the plots produced on the Windows machine? I have also tried using win.metafile on the Windows machine and the quality looks the same as
2011 Sep 27
2
Coercing a character zoo to a numeric
Dear R-helpers, It seems to me that a character zoo cannot be coerced to a numeric zoo. Below is a minimal example. Can someone tell me what I have done wrong? > z<-zoo(1:4,order.by=1:4) > coredata(z)<-as.character(coredata(z)) > str(z) ‘zoo’ series from 1 to 4 Data: chr [1:4] "1" "2" "3" "4" Index: int [1:4] 1 2 3 4 >
2009 Jun 19
1
(FULL) Need help to optimize a piece of code involving zoo objects
(Sorry, sent the message before I finished it) Hello, everyone I have a long script that uses zoo objects. In this script I used simple moving averages and these I can very efficiently calculate with filter() functions. Now, I have to use special "exponential" moving averages, and the only way I could write the code was with a for-loop, which makes everything extremely slow. I don't
2009 Jun 19
1
Need help to optimize a piece of code involving zoo objects
Hello, everyone I have a long script that uses zoo objects. In this script I used simple moving averages and these I can very efficiently calculate with filter() functions. Now, I have to use special "exponential" moving averages, and the only way I could write the code was with a for-loop, which makes everything extremely slow. I don't know how to optimize the code, but I need to
2006 Nov 23
1
Problem with as.ts(zoo-object)
Dear all, I have an error message, when I try to convert a zoo object (called test) to ts (on R 2.4.0, Package zoo version 1.2-1, Windows XP) > test 1994-05-10 1994-06-09 1994-07-09 0.0024943889 0.0024881824 0.0006955831 > str(test) atomic [1:3] 0.002494 0.002488 0.000696 - attr(*, "index")=Class 'Date' num [1:3] 8895 8925 8955 > is.regular(test) [1] TRUE
2008 Oct 22
1
R 2.8.0 qqnorm produces error with object of class zoo?
Dear list-reader, by running the following script: library(zoo) sessionInfo() search() packageDescription("zoo") data(EuStockMarkets) dax <- as.zoo(EuStockMarkets[1:10, "DAX"]) daxr <- diff(log(dax)) identical(as.vector(qnorm(daxr)), qnorm(coredata(daxr))) qqnorm(coredata(daxr)) qqnorm(daxr) qqnorm() produces an error: > qqnorm(daxr) Fehler in if (xi == xj) 0L
2006 Nov 29
2
problem with indexing a zoo object
My problem is the following : I create 2 zoo objects and then I try to subset one of them using logic. indicesthatpass is a vector of trues and falses but when I send it into bckret, it returns an empty bckret. Obviously it has something to do with bckret being a zoo object and if I do the same subsctripting off of coredata(bckret), I'm confident it will work. But, I need to keep the minute
2006 Nov 03
1
as.zoo behavior (
hi all : the code pasted below runs but then, a dput on rollmeandifflogbidask gives me what is below the code. the structure of rollmeandifflogbidask is a zoo object but with a "frequency" so it's not the same structure as the original actual diff and this really causes things to blow up in later code. i'm sure gabor and achim know what to do but in the case that they are not
2012 Jun 06
2
package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?
Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: <------ Error in na.spline.vec(x., coredata(object.), xout = xout., ...) : attempt to apply non-function ------> I couldn't find a similar error for this case in the mailing lists and zoo vignette,
2011 Jan 24
2
how to slice a zoo object
Hi Would anyone have any pointers on how to slice up a large zoo table. I have the following structure: - > str(ZOO_OBJ) ?zoo [1:632, 1:83] 30.4 30.4 30.4 30.4 30.3 ... ?- attr(*, "dimnames")=List of 2 ??..$ : NULL ??..$ : chr [1:83] "COL1" "COL2" "COL3" "COL4" ... ?- attr(*, "index")= POSIXct[1:632], format: "2009-05-01
2011 Mar 15
2
Pointwise division of two zoo objects?
Just trying to create returns from prices, and do something like: returns.z = tail(prices.z,-1)/head(prices.z,-1) - 1 # should be equivalent to returns = exp(diff(log(prices.z))) - 1 Curiously, I get a zoo object back with zeros everywhere and also with the index having one fewer element than it should. Does anyone know how to pointwise divide zoo objects, and what exactly "/" is
2010 Aug 25
2
Repeat the first day data through all the day. Zoo
down vote favorite Hello I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of the day. That's, The first element everyday is repeated throughout the wole day. This is not same as aggregate(originalseries,as.Date,head,1) because this gives a
2010 Jun 15
6
working with zoo time index ??
Hello Where could I find examples on how to work with the time index in a timeseries or zoo series? Let say I've got this series DATA 1990-01-01 10:00:00 0.900 1990-01-01 10:01:00 0.910 1990-01-01 10:03:00 0.905 1990-01-01 10:04:00 0.905 1990-01-01 10:05:00 0.890 ....................... 2000-12-31 20:00:00 0.992 How do I make simple calculations such as ... ? Calculate the
2010 Aug 20
1
differecing a zoo series
A quick question x <- as.yearmon(2000 + seq(0, 23)/12) x [1] "Jan 2000" "Feb 2000" "Mar 2000" "Apr 2000" "May 2000" "Jun 2000" "Jul 2000" "Aug 2000" "Sep 2000" "Oct 2000" "Nov 2000" "Dec 2000" "Jan 2001" [14] "Feb 2001" "Mar 2001" "Apr
2008 Mar 03
1
Formating a zoo dataset .
Suppose I have following dataset : > head(data1) Date Return 1 03/31/00 0.14230650 2 04/28/00 -0.03276228 3 05/31/00 -0.06527890 4 06/30/00 -0.04999873 5 07/31/00 -0.01447902 6 08/31/00 0.22265729 Now I convert it to zoo object : > data11 = zoo(data1[,2], as.Date(data1[,1], format="%m/%d/%y")) > head(data11) 2000-03-31 2000-04-28 2000-05-31
2008 Mar 06
1
can't merge zoo ojects and convert to ts (been trying for 2 days)
I'm stuck, but am sure it can be done I just don't understand how. I have data in an irregular timeseries. I want to be able to use stl to visualise the data (see seasonal parts etc), so I need to change to regular series of class ts (I think). I am using 2 zoo objects one is regular and the other is my irregular data. I am then merging to create the object I want but when I try to change
2005 Nov 14
2
[<- and indexing for zoo objects
Hi I've been greatly enjoying the functionality the zoo package offers. However I've hit a snag with the following code > a <- zoo(matrix(1:10,5,2), 2001:2005) > a 2001 1 6 2002 2 7 2003 3 8 2004 4 9 2005 5 10 > a[I(2003), 2] 2003 8 > a[I(2003), 2] <- NA Error: subscript out of bounds > I've also tried > coredata(a[I(2003), 2])
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