Very new to R, but I'm trying to get two simple x,y (date, value) graphs. The sets of values I'm trying to graph are subsets of a larger set of similar values. The graph is essentially representing the entire set instead of the subsets on the x-axis. Here's what I have:
mydata <- read.csv("~/Downloads/AUESA.csv") # columns: DATE, AUESA
aft <- mydata[as.Date(mydata$DATE) > as.Date('2016-11-01'), ]
bef <- mydata[as.Date(mydata$DATE) < as.Date('2016-11-01') & as.Date(mydata$DATE) >= as.Date('2015-05-01'), ]
par(mfrow=c(1,2))
plot(x = aft$DATE, y = aft$AUESA, type = 'l')
plot(x = bef$DATE, y = bef$AUESA, type = 'l')
As you can see, the x-axis limits are off
I've tried:
plot(x = aft$DATE, y = aft$AUESA, type = 'l', xlim = as.Date(c('2016-11-01', '2018-05-01')))
plot(x = bef$DATE, y = bef$AUESA, type = 'l', xlim = as.Date(c('2015-05-01', '2016-11-01')))
But it just graphs an empty graph with the correct x-axis limits.
Any comments or suggestions are helpful. Thanks.