Message-ID: <CAP01uRmVLHCkb25L=aUPgvZPbJmU2k5ocKT4MyaVkeEbudr0xA@mail.gmail.com>
Date: 2012-05-06T17:16:06Z
From: Gabor Grothendieck
Subject: PLot a matrix
In-Reply-To: <CAN5rfDNFnXaTgsu7Tj8ULLej=1w4CSjkwK5jd5oh02AdXOCHuA@mail.gmail.com>
On Sun, May 6, 2012 at 11:39 AM, Trying To learn again
<tryingtolearnagain at gmail.com> wrote:
> Hi,
>
> I want to plot this matrix (I attach the data), it is suposed that each
> column is a different time series.
>
> If I do
>
> g<-read.table("dataADF.txt", header=F)
>
> and
>
> plot(g[,1],type="l")
>
> it ?plots the first column plot if I want in a unique graph each colums of
> dataA, all in one. How should I proceed?There is a direct pre-defined code?
>
> And ?If I wanted a plot by each column?
>
Try this:
library(zoo)
URL <- "http://r.789695.n4.nabble.com/attachment/4613171/0/dataA.txt"
z <- read.zoo(URL, index = 0)
plot(z) # multi-panel
plot(z, screen = 1, col = 1:5) # single panel
See ?plot.zoo for more details.
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com