plot_gwl_map | R Documentation |
this function plots a map of the beta coefficients for a selected column (aka species).
For this function to work, the coordinates supplied to gwl_fit()
must be named "Lat" and "Long".
The function is not bulletproof yet but is added here to reproduce the maps from the original publication.
plot_gwl_map(x, column, crs = 4326)
x |
a |
column |
the name of a variable to be plotted on the map. Must be quoted. for instance "NEB.MIN" |
crs |
the crs projection for the map (default is mercator WGS84). See |
a ggplot object
data(Amesbury)
distance_matrix <- compute_distance_matrix(Amesbury$coords[1:30,], add.noise = TRUE)
my.gwl.fit <- gwl_fit(bw= 20,
x.var = Amesbury$spe.df[1:30,],
y.var = Amesbury$WTD[1:30],
dist.mat = distance_matrix,
adaptive = TRUE,
kernel = "bisquare",
alpha = 1,
progress = TRUE)
if(requireNamespace("maps")){
plot_gwl_map(my.gwl.fit, column = "NEB.MIN")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.