similar to: xts/time-series and plot questions...

Displaying 20 results from an estimated 1300 matches similar to: "xts/time-series and plot questions..."

2011 Jul 21
1
nested loop for
Hi everyone, I have been working some days in a nested loop in R but I can't find the solution. I have a data.frame with an unique ID for individuals and unique ID for different stands, for each indiviadual I have a dbh record and a SBA (stand basal area) field. Pma<-rep (1:40) P<-seq(1,4, 1) Plot<-rep(P,10) dbh2<-rnorm(40, mean=200, sd=5) SBA2<-rnorm(40, mean=10, sd=1) As
2012 May 16
1
Merging multiple data sets
Hello R user, I have four data sets in dir "D:/Bharat Warule/Rdata_file" which are output_data_prod_1.rda, output_data_prod_2.rda, output_data_prod_3.rda, output_data_prod_4.rda. Each data set is huge size like number of rows 343297 and columns are near to 50. For example: x1 <- data.frame(x11=c(1,2,3,4,5),x112=c(10,10,10,10,10)) x2 <-
2011 Nov 15
2
Putting directory path as a parameter
Hi List, I am new to R, this may be simple. I want to store directory path as parameter which in turn to be used while reading and writing data from csv files. How I can use dir defined in the below mentioned example while reading the csv file. Example: dir <- "C:/Users/Desktop" #location of file temp_data <- read.csv("dir/bs_dev_segment_file.csv") If I run this
2007 Aug 22
8
How to spec an attachment_fu model
First off, I''m not trying to spec attachment_fu, I know it''s been tested. But, I added some code to that model that I do need to test. Basically, I need to somehow fulfill the "uploaded_data" property so I can actually run my tests(otherwise they fail because of validations). The "uploaded_data" field is what would grab the multipart data from form. Here
2013 Jul 18
1
Bland Altman summary stats for all column combinations
Hello, I have the following data.frame structure(list(Study = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
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-01-04 11:45:38
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 library is done statically... etc...
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 of class: [POSIXt,POSIXct] TZ: Original class: 'double' xts
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
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" "2010-01-04 09:45:03" ... $ bid_hsi: int 21850
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 <-
2011 Oct 08
1
Filling missing days in xts time series
Hi, I have a bunch of irregularly spaced xts time series (with a POSIX index), and I'm trying to write a function that fillls the missing days. Using a solution suggested by Gabor Grothendieck for zoo, I wrote the following: # FD: Fill missing days FD<-function(ser) {rng<-range(time(ser)) > temp<-merge(ser,xts(,seq(rng[1],rng[2],"day"))) >
2013 May 13
1
Math problem with xts objects
Hello, I coming across a strange problem doing math on an xts object. If I have an xts object of stock prices (perhaps 5 minute bars of open, high, low,close) and want to do some math, the results fail. For example: d$close[10] - d$open[10] works perfectly d$close[10] - d$open[9] fails. I just get an answer of "numeric(0) Index: numeric(0)". My guess is that xts is breaking
2011 Mar 07
1
Associating the day of week to a daily xts object
I have the following xts objetct "temp" > str(temp) An ?xts? object from 2010-12-26 to 2011-03-05 containing: Data: num [1:70, 1] 2.95 0.852 -0.139 1.347 2.485 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr "t_n" Indexed by objects of class: [POSIXct,POSIXt] TZ: GMT xts Attributes: NULL > temp t_n 2010-12-26
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, 5), order.by =
2009 Jun 25
1
apply on xts
Hi, I do not understand why after I called apply on a function that returns an xts (getIdvAdjSeries) it returns a matrix whose columns are just numeric value of time series in xts instead of a list of xts objects. Basically, I called the following: apply(matrix(tickers,ncol=1),1,FUN=getDivAdjSeries) getDivAdjSeries <- function(ticker) { seriesName <-
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 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
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
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: