Skip to content

Plotting by factor with xts

2 messages · Nick Torenvliet, Gabor Grothendieck

#
On Sat, Jan 22, 2011 at 12:46 PM, Nick Torenvliet
<nick.torenvliet at gmail.com> wrote:
read.zoo has a split argument.  Assume we have a data frame with Date,
Symbol and Price columns. Then:

DF <- data.frame(Date = Sys.Date() + c(1:4, 1:4), Symbol =
rep(LETTERS[1:2], each = 4), Price = 1:8)

library(zoo)
z <- read.zoo(DF, split = 2)
plot(z, screen = 1)