R/pull_vc_out.R

#' Extracts vaccination campaigns
#'
#' @param vc.in.line Vaccination coverage in line.
#' @param mm Number identifying row of campaign.
#' @examples
#' pull.vc.out(55,250)
#' @keywords internal


#Function to pull out
pull.vc.out<- function(vc.in.line, mm) {
  vac.id<-vc.in.line$vac.id
  loc.mat<-separate.locations(adm0 = vc.in.line$country.code, loc.id = vc.in.line$location.id)
  return(cbind(vc.in.line[rep(1, nrow(loc.mat)), mm[!is.na(mm)]], loc.mat[, -1]))
} 
arranhamlet/popvac_package documentation built on May 10, 2019, 1:48 p.m.