similar to: Time series merge?

Displaying 20 results from an estimated 10000 matches similar to: "Time series merge?"

2011 Nov 08
3
window?
Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d <- rep(1:53,2) (s <- ts(d, frequency=53, start=c(2000,10))) n <- length(s) k <- n%/%3 for(i in (n-k):n) { st <- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] + i) %% frequency(s)) ed <- c(start(s)[1] +
2011 Nov 22
1
Missing data?
I was wondering what the best approach is for missing data in a time series. I give an example using xts but I would like to know what seems to be the "best" method. Say I have library(xts) xts.ts <- xts(1:4,as.Date(c("1970-01-01", "1970-1-3", "1980-10-10", "2007-8-19")), frequency=52) I would like to turn this into a time series (still
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 =
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:
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 time using something else
2011 Apr 04
3
How to speed up grouping time series, help please
I retrieve for a few hundred times a group of time series (10-15 ts with 10000 values each), on every group I do some calculation, graphs etc. I wonder if there is a faster method than what presented below to get an appropriate timeseries object. Making a query with RODBC for every group I get a data frame like this: > X ID DATE VALUE 14 3 2000-01-01 00:00:03 0.5726334
2017 Sep 16
0
require help
oky.. thank you very much to all of you On Sat, Sep 16, 2017 at 2:06 PM, Eric Berger <ericjberger at gmail.com> wrote: > You can just use the same code that I provided before but now use your > dataset. Like this > > df <- read.csv(file="data2.csv",header=TRUE) > dates <- as.Date(paste(df$year,"-01-01",sep="")) > myXts <-
2011 Nov 07
3
Upgrade R?
I am trying to upgrade to R 2.14 from R 2.13.1 I have compied all the libraries from the 'library' directory in my existing installation (2.13.1) to the installed R 2.14. Now I want to uninstall the old installation (R 2.13.1) and I get the error: Internal Error: Cannot find utCompiledCode record for this version of the uninstaller. Any ideas? Kevin [[alternative HTML
2011 Nov 05
1
acf?
I started to check what I thought I knew with autocovariance and it doesn’t jive with the the calculations given by ‘R’. I was wondering if there is some scaling or something that I am not aware of. Take the example Ø d <- 1:10 Ø (a <- acf(d, type="covariance", demean=FALSE, plot=FALSE)) Autocovariances of series ‘d’, by lag 0 1 2 3 4 5 6
2017 Sep 16
2
require help
You can just use the same code that I provided before but now use your dataset. Like this df <- read.csv(file="data2.csv",header=TRUE) dates <- as.Date(paste(df$year,"-01-01",sep="")) myXts <- xts(df,order.by=dates) head(myXts) #The last command "head(myXts)" shows you the first few rows of the xts object year cnsm incm wlth
2017 Sep 22
2
require help
Assuming the input data.frame, DF, is of the form shown reproducibly in the Note below, to convert the series to zoo or ts: library(zoo) # convert to zoo z <- read.zoo(DF) # convert to ts as.ts(z) # Note: DF <- structure(list(year = c(1980, 1981, 1982, 1983, 1984), cnsm = c(174, 175, 175, 172, 173), incm = c(53.4, 53.7, 53.5, 53.2, 53.3), with = c(60.3, 60.5, 60.2, 60.1, 60.7)),
2010 Mar 22
2
Factors attribute?
I noticed that when I fit a linear model using 'lm' there is an attribute called "factors" that is added to the "term". It doesn't seem to appear for 'model.matrix', just 'lm'. I have been unable to find where it gets constructed or what it means? It looks like a two dimensional array that I may be able to use so I would just like to get some
2011 May 15
3
Adding dates to time series
Hi there, I have a spreadsheet in excel which consists of first column of dates and then subsequent columns that refer to prices of different securities on those dates. (the first row contains each series name) I saved the excel file as type csv and then imported to excel using prices=read.csv(file="C:/Documents and Settings/Hugh/My Documents/PhD/Option prices.csv",header = TRUE, sep
2011 Oct 22
7
"Plotting" text?
I noticed that the text() command adds text to a plot. Is there a way to either make the plot blank or add text to a "blank sheet". I would like to "plot" a page that contains just text, no plot lines, labels, etc. Suggestions? Kevin [[alternative HTML version deleted]]
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
2011 Nov 10
3
Title for a group of plots?
I can get multiple plots on a page like: op <- par(mfcol = c(3, 1)) What I was wondering is if there is a way to have a title for the whole page? I can specify the title for each individual plot like: plot(xxx, main=".") But I would like a 'title' for the group of plots. Is this possible? Thank you. Kevin [[alternative HTML version deleted]]
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 Feb 23
3
Using string to call/manipulate an object
I am using getSymbols function from quantmod package to get price data from internet. Currently I have: my.ticker <- "IBM" getSymbols(my.ticker,src="google") This creates an xts object named my.ticker which contains historical price data for IBM. How can I call and manipulating this xts object using my original string my.ticker? I want to do: colnames(my.ticker) <-
2012 Feb 08
1
"Zoomable" time series plots
Not sure if the question is appropos, but I have multiple csv's which are read into an xts object, corresponding to telemetry data (accelerometer, magnetometer/compass, and gyroscope). For examination, it would be ?ber useful if plot.zoo (or something similar) allowed me to zoom in and out of a subset of the time axes. -- Sent from my mobile device Envoyait de mon portable