Learn R Programming

geocausal (version 0.4.0)

get_base_dens: Get the baseline density

Description

`get_base_dens()` takes a dataframe and returns the baseline densities using Scott's rule of thumb (out-of-sample data).

Usage

get_base_dens(
  window,
  ndim = 128,
  resolution = NULL,
  out_data = NULL,
  out_coordinates = c("longitude", "latitude"),
  input_crs = 4326,
  unit_scale = 1000
)

Value

an im object of baseline density

Arguments

window

owin object

ndim

the number of dimensions of grid cells (ndim^2). By default, ndim = 128.

resolution

the resolution in km per pixel. If specified, overrides `ndim`. For example, `resolution = 5` creates ~5km x 5km grid cells.

out_data

dataframe

out_coordinates

vector of column names of longitudes and latitudes (in this order)

input_crs

the CRS of the input coordinates. Defaults to 4326

unit_scale

parameter to convert meters to kilometers (WGS84 decimal degrees). The function will transform these to match the window projection