fill_PA_area: Impute missing personnel numbers proportionally to the known...

View source: R/data.R

fill_PA_areaR Documentation

Impute missing personnel numbers proportionally to the known density in surveyed areas

Description

This function modifies the numbers of personnel for countries/territories where it is partially known. For those countries/territories, it assumes that the unsurveyed area have a density of personnel proportional to the density in the surveyed areas. The proportionality is set by the argument coef: - e.g. if coef = 1, then unsurveyed areas are populated with the same density as the surveyed areas. - e.g. if coef = 0.5, then unsurveyed areas are populated with half the density as the surveyed areas.

Usage

fill_PA_area(data, coef)

Arguments

data

a data.frame or tibble produced by fetch_data()

coef

the coefficient used for the propagation

Value

a dataframe or tibble

Examples

data_rangers_50 <- fill_PA_area(data_rangers, coef = 0.5)
surveyed_fraction <- with(data_rangers, PA_area_surveyed /
     (PA_area_surveyed + PA_area_unsurveyed))
plot(surveyed_fraction,
     surveyed_fraction * data_rangers_50$staff_rangers / data_rangers$staff_rangers,
     ylim = c(0, 1), xlim = c(0, 1))
polygon(x = c(0, 1, 0, 0), y = c(0, 1, 0.5, 0))


courtiol/rangeRinPA documentation built on Sept. 29, 2022, 9:54 a.m.