search for: xts

Displaying 20 results from an estimated 456 matches for "xts".

Did you mean: its
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...
2009 Nov 16
0
OCaml-R and xts works!
Hi. I've managed to make a *very* simple wrapper around the xts library for R into OCaml. (Need to be downloaded from CRAN for OCaml users, but I expect other wrapping to be fairly similar...). The good, good, good thing (from my humble point of view) is that all loading is done statically: Loading the R interpreter is done statically. Loading the xts libr...
2011 Jan 04
1
XTS : merge.xts seems to have problem with character vectors
Hi, Please can you tell me what I am doing wrong. When trying to merge two xts objects, one of which has multiple character vectors for columns...I am just getting NAs. > str(t) POSIXct[1:1], format: "2011-01-04 11:45:37" > y2 = xts(matrix(c(letters[1:10]),5), order.by=as.POSIXct(c(t + 1:5))) > names(y2) = c(1,2) > y2 1 2 2011-...
2015 Nov 04
1
setOldClass("xts")
Hello, I apologize that I am cross posting here after getting no answer from my initial question on stack overflow <http://stackoverflow.com/questions/33492601/r-setoldclass-only-if-needed>. I should certainly have posted it first here.. I am using 3 packages: - xts - quantmod - 'myPackage' quantmod is creating a union class by doing: setOldClass("xts"); setClassUnion("xtsORzoo", c("xts","zoo")) In 'myPackage' I am also creating a union class by doing setOldClass("xts"); setClassUnion(...
2011 Aug 22
2
Duplicate Rows in xts
I read enourmous comment about this questions stating that it was answered before.? I?have been looking for the answer for a week without luck !!!? I searched the archives the xts. vignitte , googled for an answer but couldn't find one so her it is: ? the Vignette states that xts "doesn't inforce the duplicate row requirement" but yet when I try to bring in tick stock data from a data frame as.xts it complains that the string is in an ambigious format. ? T...
2009 Nov 12
1
xts conversion problem
I have two data frames, with two columns each, the first being a Date variable. I would like to convert them to xts objects, indexed by the Date column. I would like to use as.Date and not as.POSIXct as the dateformat. The puzzling fact is that it works for the first one but not the other. Here is a screenshot of the error: > str(DF1) 'data.frame': 367 obs. of 2 variables: $ Date:Class 'Date&...
2012 May 29
2
Converting to XTS loses data.frame structure
Hello, I noticed something odd when working with data frames and xts objects. If I read in a CSV file, R creates a nice data.frame. This works well. If I then convert to an XTS object, I see that all the values in the data are now quoted. My data is a mix of numeric and character. This is usually seen when converting a data.frame to a matrix, as R will treat al...
2012 Mar 04
1
Store vectors as values in xts time-series object
Hi R programmers, I have stumbled across what seems a very simple problem. My goal is to create a xts time series object which contains vectors as values. In other words, I try to create something like this: 2009-01-01 => c('aa', 'bb', 'dd') ... 2010-02-01 => c('mm') I have figured out parts of separately. Here's what works (new xts time-series with simpl...
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.
2017 Oct 06
2
Time series: xts/zoo object at annual (yearly) frequency
Hi, I'd like to make a time series at an annual frequency. > a<-xts(x=c(2,4,5), order.by=c("1991","1992","1993")) Error in xts(x = c(2, 4, 5), order.by = c("1991", "1992", "1993")) : order.by requires an appropriate time-based object > a<-xts(x=c(2,4,5), order.by=1991:1993) Error in xts(x = c(2, 4,...
2012 Nov 02
2
override date in xts time series
Using the following bit of R, I'm wondering if there is a way to override/manipulate/replace the date in one xts time series with the date of another xts time series while not affecting/changing the times of the xts time series? library(xts) x.Date <- rep("1/1/2004",times=5) x.Times<- c("00:00:00", "00:15:00", "00:30:00", "00...
2010 Aug 17
0
Merge xts
Hi all , I have 12 xts objects of differing timeseries stamp. For example : > str(s1_predict.xts) An ?xts? object from 1990-03-25 20:00:00 to 1990-12-15 09:00:00 containing: Data: num [1:725, 1] 11.23 10.18 9.3 9.74 10.18 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : NULL Indexed by objects...
2012 Feb 16
3
Converting ts into xts and subsetting
Greetings, I would like to subset observations in a time series using xts, after converting from ts to xts. X=ts(1:100, frequency=12, start=c(1976)) X2=as.xts(X) X2["1984"] The output: Feb 1984 98 Mar 1984 99 Apr 1984 100 What happened to January? The index is always one month off, with X2["1976-01"] giving me Feb 1976. Should I set the tim...
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...
2011 Jul 30
1
Plot.xts - how to change the x-axis labels to show weekly labels.
Dear R-users I am new to R and struggling not to bother the list with silly questions. I read the documentation on xts and searched for some examples over the internet on how to use plot.xts. The xts object is as follows dataxts : An 'xts' object from 2010-06-27 to 2010-08-05 containing: Data: num [1:56161, 1:14] 74 74.2 74.2 74.1 73.9 ... Indexed by objects of class: [POSIXct,POSIXt] 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: &g...
2010 Jun 08
1
Efficiency question
Given the following snippet.... m.nf.xts <- xts(rep(0, length(index(m.xts))), order.by=index(m.xts)) Does R know to cache the index(m.xts) or is it more efficient to say... m.i <- index(m.xts) m.nf.xts <- xts(rep(0, length(m.i)), order.by=index(m.i)) ? cheers Worik [[alternative HTML version deleted]]
2010 Dec 06
1
as.xts error
Dear all, I am using the as.xts function to transfer a data frame to the xts The following is the code and result: a<-read.csv("price.csv") a$Date<-as.POSIXct(a$Date) str(a) 'data.frame': 15637 obs. of 2 variables: $ Date : POSIXct, format: "2010-01-04 09:45:01" "2010-01-04 09:45:02&...
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...
2011 Dec 24
1
Optimising timeboxing in xts
I don't know if timeboxing is the correct term to use to accomplish what I'm attempting, so allow me to explain. I have a set n of tagged observations in time series t. What I'm interested in is taking i seconds before and after every n. My code is below: # observations.xts is an xts time series and arg is the number of seconds to for the timebox timeboxes <- sapply(c(1:as.numeric(last(index(observations.xts))-arg)), function(x) { return(observations.xts[index(x) - arg, index(x)+arg])}, simplify=TRUE) What I'd like to see in timeboxes is observations.xts elemen...