aw_total {areal}R Documentation

Calculate Total Area

Description

aw_total produces a new total area field that contains the total area by source id. This is the second step in the interpolation process after aw_intersect.

Usage

aw_total(.data, source, id, areaVar, totalVar, type, weight)

Arguments

.data

A sf object that has been intersected using aw_intersect

source

A sf object with data to be interpolated

id

A unique identification number

areaVar

The name of the variable measuring a feature's area, which is created as part of aw_intersect

totalVar

The name of a new total area field to be calculated

type

One of "intensive" or "extensive"

weight

One of "sum" or "total"

Value

A sf object with the intersected data and new total area field.

Examples

library(dplyr)

race <- select(ar_stl_race, GEOID, TOTAL_E)
wards <- select(ar_stl_wards, WARD)

wards %>%
    aw_intersect(source = race, areaVar = "area") -> intersect

aw_total(intersect, source = race, id = GEOID, areaVar = "area",
         totalVar = "totalArea", weight = "sum", type = "extensive")


[Package areal version 0.1.8 Index]