Skip to content
Prev 138088 / 398506 Next

How to create following chart for visualizing multivariate time series

"Henrique Dallazuanna" <wwwhsd at gmail.com> wrote in
news:da79af330802290329y4c0ad78fkc483303229a868ae at mail.gmail.com: 

library(lattice)
levelplot(r, colorkey=list(col=gray((0:32)/32)),
     col.regions=(col=gray((0:32)/32)))

When I try that example, I get an error, even after updating lattice.
+  col.regions=(col=gray((0:32)/32)))
Error in UseMethod("levelplot") : no applicable method for "levelplot"

If I simply change colorkey=FALSE to colorkey=TRUE in the first levelplot 
help page example, I have what looks to me as "success".

levelplot(z~x*y, grid, cuts = 50, scales=list(log="e"), xlab="",
          ylab="", main="Weird Function", sub="with log scales",
          colorkey = TRUE,
          region = TRUE)