X-Git-Url: http://git.vanrenterghem.biz/R/project-au-taxstats.git/blobdiff_plain/f4d8198bed7da31848d4fe7a8d3876e81ac87a98..refs/heads/master:/AU-taxstats.R?ds=sidebyside diff --git a/AU-taxstats.R b/AU-taxstats.R index 92577c6..1ca7b75 100644 --- a/AU-taxstats.R +++ b/AU-taxstats.R @@ -47,7 +47,7 @@ sa3 <- st_read(dsn = "data/", layer = "SA3_2016_AUST", stringsAsFactors = FALSE) POA_SAs <- st_intersects(x=sa3, y=POA, sparse=FALSE) taxstats.POA$`Total.Income.or.Loss..`[is.na(taxstats.POA$`Total.Income.or.Loss..`)] <- 0 taxstats.POA$`Total.Income.or.Loss.no.`[is.na(taxstats.POA$`Total.Income.or.Loss.no.`)] <- 0 -# Perform matrix multiplication to obtain the income metrix per SA3 +# Perform matrix multiplication to obtain the income metrics per SA3 # Total income will be incorrect, as the POAs intersect with multiple SA3s sa3$TotalIncome <- as.vector(POA_SAs %*% as.matrix(taxstats.POA$`Total.Income.or.Loss..`)) sa3$TotalIncomeEarners <- as.vector(POA_SAs %*% as.matrix(taxstats.POA$`Total.Income.or.Loss.no.`))