From 528f102dcf592c7de86adc69d14bfd0f86606153 Mon Sep 17 00:00:00 2001 From: l-gorman Date: Fri, 18 Aug 2023 17:19:56 +0100 Subject: [PATCH] fixing household size calculation again --- R/HouseholdSize.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/HouseholdSize.R b/R/HouseholdSize.R index 8251b79..cee3283 100644 --- a/R/HouseholdSize.R +++ b/R/HouseholdSize.R @@ -58,9 +58,9 @@ identify_person_category <- function(age, gender) { gender <- substr(tolower(gender),0,1) vector[age < 4] <- "children_under_4" - vector[age >= 4 & age < 1] <- "children_4to10" - vector[age > 11 & age <= 24 & gender == "m"] <- "males11to24" - vector[age > 11 & age <= 24 & gender == "f"] <- "females11to24" + vector[age >= 4 & age < 10] <- "children_4to10" + vector[age >= 11 & age <= 24 & gender == "m"] <- "males11to24" + vector[age >= 11 & age <= 24 & gender == "f"] <- "females11to24" vector[age > 24 & age <= 50 & gender == "m"] <- "males25to50" vector[age > 24 & age <= 50 & gender == "f"] <- "females25to50" vector[age > 50 & gender == "m"] <- "malesover50"