Displaying 2 results from an estimated 2 matches for "dt_xts".
Did you mean:
dt_xjs
2016 Apr 18
0
Add a vertical arrow to a time series graph using ggplot and xts
...ror message occurs when I run the program, sometimes it
does not occur until I call the plot "p1". How could I add a vertical line
to the plot? Thanks!
Miao
######################
library(xts) # primary
#library(tseries) # Unit root tests
library(ggplot2)
library(vars)
library(grid)
dt_xts<-xts(x = 1:10, order.by = seq(as.Date("2016-01-01"),
as.Date("2016-01-10"), by = "1 day"))
colnames(dt_xts)<-"gdp"
xmin<-min(index(dt_xts))
xmax<-max(index(dt_xts))
df1<-data.frame(x = index(dt_xts), coredata(dt_xts))
p<-ggplot(data = df1, m...
2016 Apr 20
0
Add a vertical arrow to a time series graph using ggplot and xts
Please see updates to df2 assignment as shown below.
library(xts) # primary
#library(tseries) # Unit root tests
library(ggplot2)
library(vars)
library(grid)
dt_xts<-xts(x = 1:10, order.by = seq(as.Date("2016-01-01"),
as.Date("2016-01-10"), by = "1 day"))
colnames(dt_xts)<-"gdp"
xmin<-min(index(dt_xts))
xmax<-max(index(dt_xts))
df1<-data.frame(x = index(dt_xts), coredat...