Level Plots in R

I am working with R. I am trying to follow the instructions here and make a "level plot" : levelplot function - RDocumentation

I generated some data for this example:

library(lattice)
a <- rnorm(100,10,10)
b <- rnorm(100,5,5)
c <- rnorm(100,1,1)
d <- data.frame(a,b,c)

Then, I tried to make the "level plot":

levelplot(c~a*b, d, cuts = 50, scales=list(log="e"), xlab="",
          ylab="", main="Weird Function", sub="with log scales",
          colorkey = TRUE, region = TRUE)

This seemed to run, but produced a warning message:

Warning messages:
1: In levelplot.formula(c ~ a * b, d, cuts = 50, scales = list(log = "e"),  :
  NaNs produced
2: In levelplot.formula(c ~ a * b, d, cuts = 50, scales = list(log = "e"),  :
  NaNs produced

And the resulting plot (left) looks very "empty" compared to the usual outputs for this function (right):

enter image description here

Does anyone know why this is happening?

Thanks

r

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.