pe: Calculates each version of PE

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Function used to calculate the Protection Equality metric

Usage

1
pe(data = list(), version = "proportional", plot_pe = TRUE, correct = TRUE)

Arguments

data

data is a dataframe with two columns: ai and pi. ai is the total area of the ecoregion/habitat i, and pi is the protected area of the ecoregion/habitat i.

version

version is either 'proportional' (when the y axis is pi/ai) or 'fixed' (when the y-axis is pi (ha)). Defaults to proportional

plot_pe

plots the PE curve against the Lorenz curve for the data. Defaults to TRUE

correct

If N is <= 5 the returned PE is the corrected PE for small N. Defaults to TRUE but can be set to FALSE

Details

No more details required

Value

PE

Protection Equality value (0 is unequal and 1 is equal)

version

Version of the PE formula

N

Number of ecoregions/habitats

Geom

Comment on the geometry of the curve

Slope

Comment on the slope of the curve

Sorted_stand_xaxis

Sorted, standardized cumulative values on x-axis

Sorted_stand_yaxis

Sorted, standardized cumulative values on y-axis

Note

No further notes at this time

Author(s)

Alienor Chauvenet

References

Reference to add later

See Also

To fill in later

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
N<-10 # number of regions
set.seed(1) # generate the same random numbers each run of the code
data<-data.frame(ai=rep(0,N),pi=rep(0,N))
data$ai<-round(runif(N,1,2000000),0) # generate N ai values 

for (p in 1:N)
{
# generates pi values that are never bigger than total area (max is # ai)
  set.seed(15+p)
  data$pi[p]<-round(runif(1,0,data$ai[p]),0)
}
pe(data)
pe(data,"fixed")

AChauvenet/ProtectEqual documentation built on May 5, 2019, 11:28 a.m.