The following example from the documentation is ?levelplot .
The formula z~x*y means that z is a function of x , y and the interaction between x and y . If the function were z~x+y , this would mean that z is a function of x and y , ignoring any interaction.
For more information on the formula interface, see the help for ?formula Formula.
x <- seq(pi/4, 5 * pi, length.out = 100) y <- seq(pi/4, 5 * pi, length.out = 100) r <- as.vector(sqrt(outer(x^2, y^2, "+"))) grid <- expand.grid(x=x, y=y) grid$z <- cos(r^2) * exp(-r/(pi^3)) levelplot(z~x*y, grid, cuts = 50, scales=list(log="e"), xlab="", ylab="", main="Weird Function", sub="with log scales", colorkey = FALSE, region = TRUE)

source share