Wrapper function to calculate global and local Getis-Ord by discrete area
Usage
getis_ord_stats(
dat,
project,
varofint,
zoneid,
spat,
cat,
lon.dat = NULL,
lat.dat = NULL,
lon.spat = NULL,
lat.spat = NULL
)Arguments
- dat
Primary data containing information on hauls or trips. Table in the FishSET database contains the string 'MainDataTable'.
- project
String, name of project.
- varofint
Numeric variable in
datto test for spatial high/low clustering.- zoneid
Variable in
datthat identifies the individual zones or areas. Define if exists indatand is not named `ZoneID`. Defaults to NULL.- spat
Spatial data containing information on fishery management or regulatory zones. See
load_spatial.- cat
Variable in
spatdefining the individual areas or zones.- lon.dat
Longitude variable in
dat.Require ifzoneidis not defined.- lat.dat
Latitude variable in
dat. Require ifzoneidis not defined.- lon.spat
Variable or list from
spatcontaining longitude data. Required for csv files. Leave as NULL ifspatis a shape or json file.- lat.spat
Variable or list from
spatcontaining latitude data. Required for csv files. Leave as NULL ifspatis a shape or json file.
Details
Calculates the degree, within each zone, that high or low values of
the varofint cluster in space. Function utilizes the localG
and knearneigh functions from the spdep package. The
spatial input is a row-standardized spatial weights matrix for computed nearest
neighbor matrix, which is the null setting for the nb2listw
function. Requires a data frame with area as a factor, the lon/lat centroid
for each area, the lat/lon outlining each area, and the variable of interest
(varofint) or a map file with lat/lon defining boundaries of area/zones
and variable of interest for weighting. Also required is the lat/lon defining
the center of a zone/area. If the centroid is not included in the map file,
then find_centroid can be called to calculate the centroid of
each zone. If the variable of interest is not associated with an area/zone
then the assignment_column function can be used to assign each
observation to a zone. Arguments to identify centroid and assign variable of
interest to area/zone are optional and default to NULL.
