To dear Dr Sarkar and anyone that knows about Lattice package, I make 4 graphs by Lattice package. Each of the graphs has two time series. All the series are plotted in plain lines by default, and I would like one series to be in plain line and the other to be in dotted line in each graph. How can I modify the command of xyplot in the following line to achieve this? It seems that "key" or "auto.key" parameters are needed, but I don't know how to do it. Thank you very much! require(graphics) library(lattice) data1<-read.csv(file="G_Results_3FX1.csv", header=TRUE) xts<-ts(data1[,2:9],frequency = 4, start = c(1983, 1)) xyplot(xts, screen=list("a","a","b","b","c","c","d","d"), layout=c(2,2), scales=list(x="same",y="same")) Miao [[alternative HTML version deleted]]
On Mon, Sep 17, 2012 at 2:34 PM, jpm miao <miaojpm at gmail.com> wrote:> To dear Dr Sarkar and anyone that knows about Lattice package, > > I make 4 graphs by Lattice package. Each of the graphs has two time > series. All the series are plotted in plain lines by default, and I would > like one series to be in plain line and the other to be in dotted line in > each graph. How can I modify the command of xyplot in the following line to > achieve this? It seems that "key" or "auto.key" parameters are needed, but > I don't know how to do it. Thank you very much! > > > require(graphics) > library(lattice) > data1<-read.csv(file="G_Results_3FX1.csv", header=TRUE)Reproducible example please (the EuStockMarkets dataset may be suitable). -Deepayan> xts<-ts(data1[,2:9],frequency = 4, start = c(1983, 1)) > xyplot(xts, screen=list("a","a","b","b","c","c","d","d"), layout=c(2,2), > scales=list(x="same",y="same")) > > > > Miao > > > > >
Maybe Matching Threads
- Definition of "lag" is opposite in ts and xts objects!
- What is a better way to deal with lag/difference and loops in time series using R?
- Why can't R understand if(num!=NA)?
- How can I tabulate time series data (in RStudio or any other R editor)?
- How can we access an element in a structure