Maps the results of an mgwrsar model using an interactive Plotly map. Supports plotting coefficients, t-statistics, residuals, and fitted values. Automatically switches between a geographic map (if CRS is present) and a scatter plot.
Visualizes the results of an MGWRSAR model (coefficients, t-statistics, residuals, or fitted values)
using interactive plots via the plotly package.
If a Coordinate Reference System (CRS) is provided (either via the crs argument or stored in the model object),
the function generates an interactive map. Otherwise, it generates a standard scatter plot of the values
against the coordinates.
# S4 method for mgwrsar,missing
plot(
x,
y,
type = "coef",
var = NULL,
crs = NULL,
mypalette = "RdYlGn",
opacity = 0.8,
size = 5,
title = NULL,
show_legend = TRUE,
n_time_steps = 10,
...
)# S3 method for mgwrsar
plot(
x,
type = "coef",
var = NULL,
crs = NULL,
mypalette = "RdYlGn",
size = 5,
opacity = 0.8,
title = NULL,
show_legend = TRUE,
n_time_steps = 10,
...
)
An interactive Plotly object (Mapbox or Scatter).
A plotly object representing the interactive plot (or map).
An object of class mgwrsar.
missing (not used).
Character. The type of output to plot. Options are:
'coef': Spatially varying coefficients (default).
't_coef': t-statistics of the coefficients (visualized with a significance threshold of 1.96).
'residuals': Model residuals.
'fitted': Fitted values.
Character. The name of the variable (covariate) to plot. Required if type is 'coef' or 't_coef'.
Numeric or character. The Coordinate Reference System (e.g., EPSG code) of the coordinates.
If NULL, the function attempts to retrieve the CRS from x@my_crs.
Character. The color palette to use for the points (e.g., "RdYlGn", "Viridis"). Default is "RdYlGn".
Numeric. The opacity of the markers, between 0 and 1. Default is 0.8.
Numeric. The size of the markers. Default is 5.
Character. A custom title for the plot. If NULL, a default title is automatically generated.
Logical. Whether to display the legend. Default is TRUE.
time step for spatio-temporal model (default 10).
Additional arguments passed to the internal plot function.
MGWRSAR