plot_grid: Visualizing Point pattern

View source: R/plot_grid.R

plot_gridR Documentation

Visualizing Point pattern

Description

Plot the spatial pattern of cases by grid; aggregate the point into specified grids

Usage

plot_grid(
  x,
  y,
  Rj = NULL,
  hex = FALSE,
  grid.n = 50,
  crs = NULL,
  bnd = NULL,
  basemap = NULL,
  interact = TRUE,
  gridLonLat = TRUE,
  title = ""
)

Arguments

x

Vector of x coordinates of data points.

y

Vector of y coordinates of data points.

Rj

Vector of individual reproductive numbers of data points.

hex

Logical; if'TRUE', create hexagonal grid ; if'FALSE', create square grid.

grid.n

Number of grid cells in one direction (shorter side).

crs

Coordinate reference system of data points: numeric (EPSG code), object of class 'crs', or input string for st_crs; if NULL, using CRS of basemap, or using WGS84 (EPSG:4326).

bnd

A 4-length numerical vector of the form c(xmin, ymin, xmax, ymax) which gives the number of x and y coordinates' ranges of the map.

basemap

Object of class 'sf'; basemap plotting on map.

interact

Logical; if TRUE, plot thematic interactive map; if FALSE, static plotting non-interactive thematic map.

gridLonLat

Logical; draw latitude and longitude grid on non-interactive map.

title

Main title of plot.

Examples

data("EpiTrans")

plot_grid(x = dengue$long, y= dengue$lat, grid.n=30, basemap = Taiwan)

wenlab501/EpiTrans documentation built on July 8, 2022, 9:14 a.m.