Skip to content

Commit

Permalink
Check if injuries column name has both lower and upper bounds deaths.…
Browse files Browse the repository at this point in the history
… Ref #100
  • Loading branch information
usr110 committed May 26, 2022
1 parent 85d5c88 commit c6e6c2a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/injury_death_to_yll.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ injury_death_to_yll <- function(injuries){
k<-k+1
}


# if (colnames(injuries) %in% c('Deaths_lb', 'Deaths_ub'))
{
if (any(colnames(injuries) %in% c('Deaths_lb', 'Deaths_ub')))
{

# injuries is a tibble, GBD_INJ_YLL is a data.frame, returns a tibble
joined_injury_lb <- dplyr::left_join(injuries, GBD_INJ_YLL[,c('sex_age','sex','yll_dth_ratio')], by=c("sex_age",'sex'))
Expand Down Expand Up @@ -107,9 +106,7 @@ injury_death_to_yll <- function(injuries){

ref_injuries <- left_join(ref_injuries, ref_injuries_ub)
ref_injuries <- left_join(ref_injuries, ref_injuries_lb)
}


}

list(deaths_yll_injuries=deaths_yll_injuries,ref_injuries=ref_injuries)
}

0 comments on commit c6e6c2a

Please sign in to comment.