Learn R Programming

LabourMarketAreas (version 3.4)

AddStatistics: AddStatistics

Description

Function to evaluate statistics at LMA level based on data at community level.

Usage

AddStatistics(statData, comID.file, lma, comID.lma)

Value

data.table containing the LMA ID and the summed numerical variables from statData.

Arguments

statData

data.frame or data.table containing the ID of the communities and the numerical variables to be summed at LMA level.

comID.file

character: name of the variable containing the community ID in the statData object.

lma

list of three data.tables: clusterList, LWClus and marginals. See function findClusters.

comID.lma

character: name of the variable containing the community ID in the lma object.

Author

Daniela Ichim, Luisa Franconi

Details

This function can be used in general to compute several statistics at LMA level provided data at community level is provided. This function sums the values at community level to obtain the corresponding value at LMA level.

Examples

Run this code
# compute population totals at LMA level from population values at community level.
if (FALSE) {
out<- findClusters(LWCom=Brindisi, minSZ=1000,minSC=0.6667,tarSZ=10000,tarSC=0.75, 
verbose=TRUE)
AddStatistics(shpBrindisi[,c("PRO_COM","POP2001")], "PRO_COM",out$lma,"community" )
}

Run the code above in your browser using DataLab