data(moco)
data(brazil)
# check points
plot(brazil, cex = 0.1, col = "gray")
points(Lat ~ Lon, data = moco, col = "blue", pch = 20)
# using a retangular grid (not passed as input!)
# ex <- sHe(x = moco, coord.cols = 1:2,
# marker.cols = 3:20, marker.type = "codominant",
# grid = NULL, radius = 150)
#ex
# plot(ex, xlab = "Lon", ylab = "Lat")
# A FANCIER PLOT...
# using Brazil's coordinates as prediction grid
# ex2 <- sHe(x = moco, coord.cols = 1:2,
# marker.cols = 3:20, marker.type = "codominant",
# grid = brazil, radius = 150)
# ex2
#
# library(maps)
# borders <- data.frame(x = map("world", "brazil")$x,
# y = map("world", "brazil")$y)
#
# library(latticeExtra)
# plot(ex2, xlab = "Lon", ylab = "Lat",
# xlim = c(-75, -30), ylim = c(-35, 10), aspect = "iso") +
# latticeExtra::as.layer(xyplot(y ~ x, data = borders, type = "l")) +
# latticeExtra::as.layer(xyplot(Lat ~ Lon, data = moco))
# End (not run)
Run the code above in your browser using DataLab