as_disag.sf: Create a data.frame suitable for disaggregation regression...

as_disag.sfR Documentation

Create a data.frame suitable for disaggregation regression modelling from a sf object.

Description

Create a data.frame suitable for disaggregation regression modelling from a sf object.

Usage

## S3 method for class 'sf'
as_disag(data, rstack, response_var = "response", ...)

Arguments

data

An object of class sf containing polygons that covariates should be aggregated to and including the response variable and ID

rstack

A raster stack of class SpatRaster to be summarised at ID level

response_var

Name of the response variable found in data

...

any other arguments

Value

as_disag.sf returns a dataframe that can be used with all agouti functions.

Examples

## Not run: 
disag_data <- as_disag(data=df, rstack=covariate, response_var="cases")

## End(Not run)

timcdlucas/agouti documentation built on Feb. 8, 2024, 6:12 p.m.