Skip to content
Prev 293729 / 398513 Next

PLot a matrix

Assuming Windows OS with the data you attached copied to the clipboard:

TSdata <- read.table("clipboard", header=FALSE, sep="", na.strings="NA", 
  dec=".", strip.white=TRUE)

Then just

matplot(TSdata, type="l")

But you will probably want to select your own colors, line types, and add a
legend:

?matplot
?legend

If you want separate plots in one plot window:

par(mfrow=c(2, 3))
for (i in 1:5) {
   plot(TSdata[,i], ylab=paste("V", i, sep=""), type="l")
}

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352