View source: R/HDSpatialScan_plot.R
plot.ResScanOutput | R Documentation |
This function plots a schema or a map of the sites and the clusters
## S3 method for class 'ResScanOutput'
plot(
x,
type,
spobject = NULL,
system_conv = NULL,
colors = "red",
only.MLC = FALSE,
...
)
x |
ResScanOutput. Output of a scan function (UG, UNP, MG, MNP, PFSS, DFFSS, URBFSS, NPFSS, MPFSS, MDFFSS or MRBFSS) |
type |
character. Type of plot: "schema", "map" (the clusters are represented by circles) or "map2" (the clusters are colored on the map) |
spobject |
SpObject. SpatialObject with the same coordinates system the one used for the scan. Only considered if type is "map" or "map2" |
system_conv |
character. System to convert the coordinates for the plot. Only considered if the system used in the scan was "WGS84" and if type is "schema". Else it will be ignored. Must be entered as in the PROJ.4 documentation |
colors |
character. Colors of the clusters. If length(colors)=1 all the clusters will be in this color. Else it should be a vector of length the number of clusters to plot. |
only.MLC |
logical. Should we plot only the MLC or all the significant clusters? |
... |
Further arguments to be passed to or from methods. |
No value returned, plots a schema or a map of the sites and the clusters.
library(sp)
data("map_sites")
data("funi_data")
coords <- coordinates(map_sites)
res_npfss <- SpatialScan(method = "NPFSS", data = funi_data, sites_coord = coords,
system = "WGS84", mini = 1, maxi = nrow(coords)/2)$NPFSS
plot(x = res_npfss, type = "schema", system_conv = "+init=epsg:2154")
plot(x = res_npfss, type = "map", spobject = map_sites)
plot(x = res_npfss, type = "map2", spobject = map_sites)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.