similar to: Time series: xts/zoo object at annual (yearly) frequency

Displaying 20 results from an estimated 7000 matches similar to: "Time series: xts/zoo object at annual (yearly) frequency"

2010 Apr 18
4
confused with yearmon, xts and maybe zoo
R-listers, I am using xts with a yearmon index, but am getting some inconsistent results with the date index when i drop observations (for example by using na.omit). The issue is illustrated in the example below. If I start with a monthly zooreg series starting in 2009, yearmon converts this to "Dec-2008". Not such a worry for my example, but strange. Having converted to xts, i drop
2011 Mar 04
4
xts POSIXct index format
Hi, I cannot figure out how to change the index format when displaying POSIXct objects. Would like the xts index to display as %H:%M:%OS3 when doing viewing the xts object. Think I am missing the obvious. Cheers, Chris -- View this message in context: http://r.789695.n4.nabble.com/xts-POSIXct-index-format-tp3336136p3336136.html Sent from the R help mailing list archive at Nabble.com.
2005 May 10
1
Aggregate lag
hello, Does anybody know how to aggregate a lag series ? when I try to use aggregate I get the following message > try<-ts(1:100,start=c(1985,1),freq=12) > aggregate(try,4,mean,na.rm=T) Qtr1 Qtr2 Qtr3 Qtr4 1985 2 5 8 11 1986 14 17 20 23 1987 26 29 32 35 1988 38 41 44 47 1989 50 53 56 59 1990 62 65 68 71 1991 74 77 80 83 1992
2010 Nov 05
1
as.xts
hey I am trying to turn a dataframe into xts with the function: as.xts, but it returns the error: Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format could someone give me some pointers please the data is coming from a spreadsheet via the excel, and has 5 columns of data (date (with the date and time), open, high, low, close) (excel format) ela
2011 Nov 09
1
Are there equivalents to xblocks or rect that can be used with plot.xts?
I would like to add vertical shaded blocks in plot.xts graphs (like recession periods in FRED graphs) The reason I use plot.xts instead of plot.zoo is that I like the fact that the grid is automatically aligned with major ticks in plot.xts. xblocks() and rect() do not seem to work with plot.xts (only with plot.zoo). Are there any alternative methods that work with plot.xts? Thanks. -- View
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when one serie is monthly (end of month) and the other daily (weekdays only) - typically a monthly economic indicator and a stock index price? Thanks, TDB -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
2011 Sep 22
2
Subsetting a zooreg object using window / subset
Dear R users, I am currently working in subsetting a zooreg() object using either window or subset. I have a solution but it may be a bit cumbersome when I start working with actual data. Your inputs would be greatly appreciated. Example: I have a zooreg() object that starts in 1997 and ends in 2001. This object contains daily data for the 4 years
2011 Sep 08
1
Seasonal and 11-day subset for zoo object
I have a zooreg object and I want to be able to generate a value for seasons and 11-day composites paste it onto my zoo data frame, along with year, month and days. Right now I have the following to work from: eg. dat.zoo.mdy <- with(month.day.year(time(dat.zoo)), cbind(dat.zoo, year, month, day, quarter = (month - 1) %/% 3 + 1, dow = as.numeric(format(time(dat.zoo), "%w")))) For
2009 Sep 25
0
differing behaviour between xts (0.6-7) and zoo (1.5-8)
Folks, I have some weekly dataseries that I convert to monthly xts (with yearmon indices), and obtain the two following extracts: > str(sig) An 'xts' object from Apr 1998 to Sep 1998 containing: Data: num [1:6, 1] 0.0083 0.2799 -0.2524 -0.0119 0.18 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr "e1" Indexed by objects of class: [yearmon] TZ:
2010 Apr 08
2
xts off by one confusion or error
Hullo I may have missed something blindingly obvious here. I'm using xts to handle some timeseries data. I've got daily measurements for 100 years. If I try to reduce the error rate by taking means of each month, I'm getting what at first sight appears to be conflicting information. Here's a small subset to show the problem: A small set of data: > vv x
2008 May 31
1
Representing 'Date' as 'Year - Quarter'
I have financial data on a a set of firms, with a quarterly period (fundamental data). The data spans 10 years, and four quarters per year. The present file (.csv) reads the Date columns as "200706" for the second quarter of 2007; "199809" for the third quarter of 1997. Is there a way I can convert it to something like "2007 Q2", "1998 Q3"? I am aware of
2008 Mar 02
1
question on lag.zoo
Hi Guys, I'm using zoo package now. I found lag is not doing what I assumed. > x <- zoo(11:21) > z <- zoo(1:10, yearqtr(seq(1959.25, 1961.5, by = 0.25)), frequency = 4) > x 1 2 3 4 5 6 7 8 9 10 11 11 12 13 14 15 16 17 18 19 20 21 > lag(x) 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 > z 1959 Q2 1959 Q3 1959 Q4 1960 Q1 1960 Q2 1960 Q3 1960 Q4
2007 Nov 17
2
Getting Annual (Conditional) Averages
Hello, I'm very new to R, and so my question is simple. I have data record with 80 years of daily temperatures in one long string. The dates are also recorded, in YYMMDD format. I'd like to learn an elegant simple way to pull out the annual averages. (Obviously, every 4th year has 366 days.) I know I can set up a formal loop to create annual records and then average. But R
2012 Dec 18
1
How to draw frequency domain plot with xts time series data
Hello, I'd like to convert the below time-series data with fft or wavelet related function and plot it. Could you let me know 1. How to convert xts data frame format to list format ? 2. How to plot fft or wavelet diagram ? Here is the data : &gt; class(zc) [1] "xts" "zoo" &gt; str(zc) An ‘xts’ object from (10/15/12 09:00:00) to (10/15/12 15:15:00)
2011 Mar 02
1
Create a zoo/xts Time Series with Millisecond jumps
Is there a easy way to create the time index for a zoo/xts object for every 100 milliseconds. eg. time Index would be: 10:00:00:100 10:00:00:200 10:00:00:300 10:00:00:400 I am looking to build an empty zoo/xts object with time index from 10am to 3pm, index jumps by 100ms each row. Thanks, Chris -- View this message in context:
2010 May 17
1
Isn't aggreate.zoo supposed to work with POSIXct (zoo/TTR/xts issue)?
library(xts) library(TTR) ndx = getYahooData("^NDX") aa = ndx$Close bb = aggregate(aa, as.yearweek, tail, 1) The last operation takes forever, and then the bb dates are messed up. The following produces the desired result: time(aa) = as.Date(time(aa)) bb = aggregate(aa, as.yearweek, tail, 1) The index of ndx and aa is of POSIXct (as reported by is(time(ndx))) , which apparently
2012 Apr 11
2
What is a better way to deal with lag/difference and loops in time series using R?
Hello, I am writing codes for time series computation but encountering some problems Given the quarterly data from 1983Q1 to 1984Q2 PI1<-ts(c(2.747365190,2.791594762, -0.009953715, -0.015059485, -1.190061246, -0.553031799, 0.686874720, 0.953911035), start=c(1983,1), frequency=4) > PI1 Qtr1 Qtr2 Qtr3 Qtr4 1983 2.747365190 2.791594762
2012 Jun 10
1
Gaps on merging xts objects
Looking for a little help figuring out what's driving gaps in data after merging two xts objects (msci.m and x2). The merge statement I'm using is ... y <-merge(x2,msci.m, all=FALSE). Here's info on the output , y: head(y) t-bill msci Sep 1985 7.310 316.963 Mar 1986 6.560 463.471 Jun 1986 6.180 498.791 Jul 1987 6.200 778.898 Aug 1987 6.400 833.519 Nov 1987
2011 Apr 06
2
A zoo related question
Dear all, please consider my following workbook: library(zoo) lis1 <- vector('list', length = 2) lis2 <- vector('list', length = 2) lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1) lis1[[2]] <- zooreg(rnorm(20), start = as.yearmon("2010-01-01"), frequency = 12) lis2[[1]] <- matrix(1:40, 20) lis2[[2]] <-
2012 Nov 27
2
Books for fully understanding internal logics on some packages(quantmod, xts, zoo and chron)
Hello, I'm very interested in using financial time series data, but I'm a beginner of R programming. I'd like to fully understand internal logics on several time-series related packages such as quantmod, xts, zoo, chron, etc. So, I read some books, 'R Cookbook' and 'Art of R Programming' and another simple tutorials. But I still can't understand grammars of the