R/gender_count.R

#' Determines the number of each type of gender in a faculty list
#' @param staff a list of faculty
#' @return list the counts of each gender
#' @export
gender_count <- function(staff){
  genders  <- determine_genders(staff)
  a <- c() # to hold the gender counts
  a["male"]     <- length(grep("male", genders))
  a["female"]   <- length(grep("female", genders))
  a["both"]     <- length(grep("both", genders))
  a["unlisted"] <- length(grep("not listed", genders))

  return(a)
}
PhilBrockman/WilliamsStaff documentation built on May 8, 2019, 1:33 a.m.