Questions tagged [xts]

xts is an R package that contains an eXtensible Time Series class and methods. xts extends and behaves like zoo.

xts is an package for analysis. It provides uniform handling of R's different time-based data classes by extending the package.

Repositories

Vignettes

Other resources

Related tags

1987 questions
6
votes
1 answer

Use endpoints function to get start points instead?

I have an xts object called Daily_Quotes that contains stock quotes. I'm using endpoints to get monthly stock quotes that I retrieved using getSymbols (from the quantmod package). I noticed that the endpoints function creates an index of the row…
NewComer
  • 205
  • 6
  • 12
6
votes
1 answer

Faster alternative to function 'rollapply'

I need to run rolling window function on a xts data which contains about 7,000 rows and 11,000 columns. I did the following: require(PerformanceAnalytics) ssd60<-rollapply(wddxts,width=60,FUN=function(x) SemiDeviation(x),by.column=TRUE) I waited…
Jairaj Gupta
  • 347
  • 4
  • 16
6
votes
1 answer

Bug in R align.time/aggregate?

I have a time series x: dput(x) structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28.8, 0, 0, 0, 0, 0, 0, 0, 0), index = structure(c(1193524740, 1193525340, 1193525940, 1193526540, 1193527140, 1193527740, 1193528340, 1193528940, 1193529540,…
Claudia
  • 996
  • 1
  • 10
  • 27
6
votes
1 answer

Split xts object by events

I have an xts object with a handful of event indicators. I need to split it by certain events, so that all entries from a given event up to the next event will be saved in the same xts, eventually creating a list of xts objects, with each containing…
amit
  • 3,332
  • 6
  • 24
  • 32
6
votes
1 answer

How to use zoo or xts with large data?

How can I use the R packages zoo or xts with very large data sets? (100GB) I know there are some packages such as bigrf, ff, bigmemory that can deal with this problem but you have to use their limited set of commands, they don't have the functions…
skan
  • 7,423
  • 14
  • 59
  • 96
6
votes
4 answers

How do I set width of candles in candle chart using plot.xts?

I have simple OHLC data in and XTS SF <- structure(c(1.064, 1.07, 1.071, 1.08, 1.08, 1.076, 1.078, 1.08, 1.08, 1.082, 1.081, 1.082, 1.074, 1.07, 1.073, 1.075, 1.081, 1.084, 1.092, 1.091, 1.097, 1.095, 1.099, 1.094, 1.096, 1.097, 1.096, 1.096,…
CHP
  • 16,981
  • 4
  • 38
  • 57
6
votes
3 answers

Forcing full weeks with apply.weekly()

I'm trying to figure out what xts (or zoo) uses as the time after doing an apply.period. Consider the following: > myTs = xts(1:10, as.Date(1:10, origin = '2012-12-1')) > apply.weekly(myTs, colSums) [,1] 2012-12-02 1 2012-12-09 …
Xodarap
  • 11,581
  • 11
  • 56
  • 94
6
votes
3 answers

Plotting two xts objects

I'm using xtsExtra to plot two xts objects. Consider the following call to plot.xts: plot.xts(merge(a,b),screens=c(1,2)) which is used to plot the xts objects a and b in two separate panels. How do I control the spacing of the y-axes? Specifically,…
Julian
  • 1,573
  • 2
  • 22
  • 36
6
votes
1 answer

suffixes in xts merge in R

When trying to merge to xts objects, it doesn't look like the suffixes arg is working properly: require(xts) x <- xts(1:10, seq.Date(from=as.Date("2012-01-01"), len=10, by=1)) y <- xts(11:20, seq.Date(from=as.Date("2012-01-01"), len=10,…
Alex
  • 19,533
  • 37
  • 126
  • 195
6
votes
0 answers

working with panel data in R

I would like to see what people use to work with panel data in R with large datasets (ie 50 mil + obs): the data.table package is useful in that it has keys and is very fast. The xts package is useful because it has facilities for doing all sorts…
Alex
  • 19,533
  • 37
  • 126
  • 195
6
votes
2 answers

using data.table to speed up rollapply

I am new to data.tables so apologies if this is a very basic question. I have heard that data.tables significantly improves computational times when working with large amounts data, and so would like to see if data.table is able to help in…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
6
votes
1 answer

No applicable method for 'time<-' applied to an object of class "c('xts', 'zoo')"

Please, put this data structure into R in order to reproduce my example: dX <- structure(c(3272.1, 3271.48, 3281.03, 3267.08, 3260.65, NA, 1616.3, 1620.1, 1639.9, 1637.4, 1669.6, 1662.2, 528.385, 529.268, 531.022, 532.424, NA, NA), .indexTZ = "",…
user1621969
  • 63
  • 1
  • 4
6
votes
3 answers

How to remove a row from zoo/xts object, given a timestamp

I was happily running with this code: z=lapply(filename_list, function(fname){ read.zoo(file=fname,header=TRUE,sep = ",",tz = "") }) xts( do.call(rbind,z) ) until Dirty Data came along with this at the end of one file: …
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
6
votes
1 answer

Converting an XTS object to a data.frame

Possible Duplicate: How to create a variable of rownames? Please run it in R: require(quantmod) setSymbolLookup(SDB=list(name="000001.sz",src="yahoo")) getSymbols("SDB",from="2010-01-01",to="2010-02-01") …
user1142618
  • 221
  • 1
  • 3
  • 8
5
votes
2 answers

Extend a weekly times series into daily

I have an xts time series of weekly values Jan 4 2004, 0.99 Jan 11 2004, 1.11 Jan 18 2004, 1.06 .... and I want to covert it to daily values Jan 4 2004, 0.99 Jan 5 2004, 0.99 Jan 6 2004, 0.99 .... Jan 10 2004, 0.99 Jan 11 2004, 1.11 Jan 12 2004,…
user210870