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
1
vote
1 answer

passing in a variable to be used with write.table

I am using quantmod to get stock prices for a ticker, which creates an xts object. When I try to write this object into a csv file, I can't seem to figure out how to call the object using the variable name. See…
Trexion Kameha
  • 3,362
  • 10
  • 34
  • 60
1
vote
1 answer

XTS object from Quantmod

Hi I would like to know how I can apply the same code that works for a single ticker with an XTS Object that has many tickers. This is the code that works for 1 tickers (Close…
Mickson
  • 43
  • 6
1
vote
1 answer

Count number of ticks in conversion to OHLC

I have an xts object in R, myticks_xts, which consists of tick data from a financial security and looks as below: myticks_xts[1:10,] V3 V4 V5 2014-01-01 21:55:34.378 1.37622 1.37693 1.37666900000 2014-01-01…
Spy_Lord
  • 133
  • 4
1
vote
1 answer

Idiomatic way to coerce xts object's data attribute to double

I am downloading data from FRED with getSymbols. This creates an xts class object with the data attribute set to type integer for the series' that I am downloading. I want these data to be of type/class double. What is an idiomatic way of doing…
mcheema
  • 850
  • 9
  • 25
1
vote
1 answer

R Subtracting Vectors Time Series

This code works despite the convolutions so I can live with what follows. It progresses from a CSV file, to a dataframe, to a list back to a dataframe, then to xts/ zoo. Is there any easier and shorter way for subtracting two vectors?…
Mike
  • 21
  • 4
1
vote
1 answer

How do I make R lattice xyplot ignore gaps in time and make a continuous timeseries plot?

I have an xts series that I'm trying to plot. This series contains of intra-day date for a month with gaps in the data on the weekend. I use xyplot (lattice) in R to plot the time series and am very pleased with the results. Unfortunately the plots…
user1480926
  • 634
  • 5
  • 12
1
vote
1 answer

Why does "xts" in R cannot recognize my date series?

births and dates are from same file and share same length. format of dates seems to be good. But xts cannot recogize it as date,why?! Thanks for your help! dates <- read.xlsx("TimeSeriesCourseworkData.xls", 1,colIndex=1,as.data.frame=TRUE) dates …
Chen
  • 117
  • 1
  • 1
  • 9
1
vote
1 answer

Split time series according to specific months

I am using xts package to split the time series in to monthly, yearly, etc. The code I am using is obsm<-split(obs, f = 'months', drop=FALSE, k = 1) where 'obs' being the whole time series with four year data (1999-2012). I can also split the…
rm167
  • 1,185
  • 2
  • 10
  • 26
1
vote
0 answers

xts objects and split

I have many "problems" but i will try to split them up as good as i can. First i will present my code: # Laster pakker library(RODBC) library(plyr) library(lattice) library(colorRamps) library(Perfor) # Picking up data query <- "select…
1
vote
1 answer

R function to aggregate data

I have an irregular time series called x: structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 22, 34, 56, 25, 78, 10, 0, 54, 55, 55, 55, 0, 0, 0, 0, 67, 0, 78, 99, 10, 10), index = structure(c(1167814140, 1167814740, 1167815340, 1167815940, 1167816540,…
Claudia
  • 996
  • 1
  • 10
  • 27
1
vote
1 answer

Aggregate xts object by time of day

I have a xts object with minute prices for each day, as below. I would like to aggregate these time series so I have a table with rowname equal to time hh:mm:ss (no day, month, year) and multiple columns for each statistic I want to calculate. …
Sergey777
  • 59
  • 1
  • 1
  • 8
1
vote
0 answers

Replace specific hour's observation with the maximum of previous day value

I have AWS hourly weather data of past few years. I was trying to extract daily data from it using .indexhour() in xts. The logger accumulate the rainfall amount 04:00:00 to 03:00:00. > head(w.ts,10) AT RH ATMP SUND RF WS…
Barun
  • 185
  • 1
  • 2
  • 10
1
vote
1 answer

How to load a 4-column table into an xts object?

I would like to start learning how to use the xts package, but I am having a hard time loading my data. The file is is about 6MB and it looks like…
user1561949
  • 211
  • 7
  • 16
1
vote
1 answer

Combine xts OHLC from different sources

I need to combine two xts objects of intraday OHLC data, a and b. One starts earlier, the other ends later and they overlap. What I need is a new xts object c that starts at the first period of a and ends with the last period of b. If for one period…
marco
  • 73
  • 1
  • 8
1
vote
1 answer

Reducing multi-column xts to single column xts based on provided column indexes

I have an xts object with multiple columns of the same type. I have another xts object with integers that correspond to column positions in the first object. I would like to generate an third xts object that contains one column representing the…
neverfox
  • 6,680
  • 7
  • 31
  • 40