surfaceplot {spStack} | R Documentation |
Make a surface plot
Description
Make a surface plot
Usage
surfaceplot(tab, coords_name, var_name, h = 8, col.pal, mark_points = FALSE)
Arguments
tab |
a data-frame containing spatial co-ordinates and the variable to plot |
coords_name |
name of the two columns that contains the co-ordinates of the points |
var_name |
name of the column containing the variable to be plotted |
h |
integer; (optional) controls smoothness of the spatial interpolation
as appearing in the |
col.pal |
Optional; color palette, preferably divergent, use
|
mark_points |
Logical; if |
Value
a ggplot
object containing the surface plot
Author(s)
Soumyakanti Pan span18@ucla.edu,
Sudipto Banerjee sudipto@ucla.edu
Examples
data(simGaussian)
plot1 <- surfaceplot(simGaussian, coords_name = c("s1", "s2"),
var_name = "z_true")
plot1
# try your favourite color palette
col.br <- colorRampPalette(c("blue", "white", "red"))
col.br.pal <- col.br(100)
plot2 <- surfaceplot(simGaussian, coords_name = c("s1", "s2"),
var_name = "z_true", col.pal = col.br.pal)
plot2
[Package spStack version 1.0.1 Index]