datSubset: Run spatial GLS models with optimal spatial correlation...

Description Usage Arguments Details Value

View source: R/datSubset.R

Description

This function runs a GLS model on a spatial dataset. It chooses among five types of correlation structure, and returns the model with the lowest AIC.

Usage

1
2
3
4
5
6
7
8
9
datSubset(
  data,
  x_coords_varname,
  y_coords_varname,
  shp_reg = NULL,
  shp_app = NULL,
  sample = NULL,
  convertFromUTM = FALSE
)

Arguments

data

data.frame that can be converted to a spatial data.frame. Coordinates must be in latitude and longitude (decimal degrees)

x_coords_varname

chr string specifying the x-coordinates in data

y_coords_varname

chr string specifying the y-coordinates in data

shp_reg

shapefile outlining the area of data to be used for the regression

shp_app

shapefile outlining the area of data to which the final simulation will be applied, if different from shp_reg

sample

integer. If the regression data are large, you may wish to sample the rows for the gls_spatial function.

convertFromUTM

logical. Set to TRUE if your shapfile(s) are in UTM coordinates.

Details

Subsets a data.frame according to provided shapefiles. The

Value

A list of two data.frames. The first is a data.frame with all points subsetted using the shp_reg shapefile. The second is a data.frame with all points subsetted using the shp_app or shp_reg shapefile, as appropriate.


natedemaagd/LandCover documentation built on April 1, 2021, 4:14 p.m.