sp_ggplot {nimblewomble} | R Documentation |
Spatial Plot Function
Description
Spatial Plot Function
Usage
sp_ggplot(
data_frame = NULL,
sp = FALSE,
shape = NULL,
legend.key.height = 0.7,
legend.key.width = 0.4,
text.size = 10,
point.size = 0.7,
clr.pt = "black",
palette = "Spectral",
extend = TRUE,
title = NULL,
bound.box = NULL
)
Arguments
data_frame |
data frame consisting of coordinates and data |
sp |
logical parameter indicating whether to make a spatial plot |
shape |
if sp = TRUE shape file should be provided (should be an sf object) |
legend.key.height |
height of legend (defaults to .7) |
legend.key.width |
width of legend (defaults to .4) |
text.size |
size of legend text (defaults to 10) |
point.size |
size of points to be plotted (defaults to 0.7) |
clr.pt |
color of point to be plotted (defaults to black) |
palette |
(optional) color palette |
extend |
logical parameter indicating whether to extend the interpolation (defaults to TRUE) |
title |
title of the plot (defaults to NULL) |
bound.box |
bounding box for spatial maps (leave as NULL if not known) |
Value
A ggplot object.
Author(s)
Aritra Halder <aritra.halder@drexel.edu>,
Sudipto Banerjee <sudipto@ucla.edu>
Examples
require(nimblewomble)
set.seed(1)
# Generated Simulated Data
N = 1e2
tau = 1
coords = matrix(runif(2 * N, -10, 10), ncol = 2)
colnames(coords) = c("x", "y")
y = rnorm(N, mean = 20 * sin(sqrt(coords[, 1]^2 + coords[, 2]^2)), sd = tau)
sp_ggplot(data_frame = data.frame(coords, z = y))
[Package nimblewomble version 0.1.0 Index]