-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8914583
commit 46102ca
Showing
109 changed files
with
1,617 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ | |
#' | ||
#' \insertRef{Prabhu2014}{tobalcepi} | ||
#' | ||
#' \lifecycle{maturing} | ||
#' | ||
#' @examples | ||
#' | ||
#' \dontrun{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
#' Diseases related to alcohol and their ICD-10 defintions | ||
#' | ||
#' Deaths in the mortality data are assigned a single ICD-10 code e.g. C00, | ||
#' but for our analysis we need to group these into cause-groups according to groups e.g. C00-C06. | ||
#' To do this, we define each group by its consituent ICD-10 codes e.g. C00, C01, C02, C03, C04, C05, C06. | ||
#' | ||
#' @docType data | ||
#' | ||
#' @format A data table | ||
#' | ||
#' @source Our alcohol disease list in the folder PR_Disease_Risk_TA | ||
#' | ||
#' | ||
#' | ||
#' | ||
#' | ||
"alc_icd10_lookups" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
#' Diseases related to tobacco and their ICD-10 defintions | ||
#' | ||
#' Deaths in the mortality data are assigned a single ICD-10 code e.g. C00, | ||
#' but for our analysis we need to group these into cause-groups according to groups e.g. C00-C06. | ||
#' To do this, we define each group by its consituent ICD-10 codes e.g. C00, C01, C02, C03, C04, C05, C06. | ||
#' | ||
#' @docType data | ||
#' | ||
#' @format A data table | ||
#' | ||
#' @source Our tobacco disease list in the folder PR_Disease_Risk_TA | ||
#' | ||
#' | ||
#' | ||
#' | ||
#' | ||
"tob_icd10_lookups" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
#' Diseases related to both tobacco and alcohol and their ICD-10 defintions | ||
#' | ||
#' Deaths in the mortality data are assigned a single ICD-10 code e.g. C00, | ||
#' but for our analysis we need to group these into cause-groups according to groups e.g. C00-C06. | ||
#' To do this, we define each group by its consituent ICD-10 codes e.g. C00, C01, C02, C03, C04, C05, C06. | ||
#' | ||
#' @docType data | ||
#' | ||
#' @format A data table | ||
#' | ||
#' @source Our joint tobacco and alcohol disease list in the folder PR_Disease_Risk_TA | ||
#' | ||
#' | ||
#' | ||
#' | ||
#' | ||
"tobalc_icd10_lookups" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
# This code stores the list of the names of diseases that are attributable to tobacco and alcohol | ||
|
||
# doing this helps to keep the formatting of disease names consistent | ||
|
||
library(data.table) | ||
library(readxl) | ||
|
||
# Set the file path to point to the University of Sheffield X drive | ||
root_dir <- "/Volumes/" | ||
|
||
|
||
########################################## | ||
|
||
# Load the data | ||
|
||
|
||
AlcList <- readxl::read_excel(paste0(root_dir, | ||
"ScHARR/PR_Disease_Risk_TA/Code/tables/16102018tobaccoandalcoholDiseaseListandRiskFunctions.xlsx"), | ||
sheet = "Alcohol") | ||
|
||
# Set it as a data table | ||
data.table::setDT(AlcList) | ||
|
||
# Columns names to consistent lower case | ||
setnames(AlcList, colnames(AlcList), tolower(colnames(AlcList))) | ||
|
||
########################################## | ||
|
||
# Save disease names | ||
|
||
alc_disease_names <- as.character(c(unique(AlcList$condition))) | ||
|
||
|
||
usethis::use_data(alc_disease_names, overwrite = T) | ||
|
||
########################################## | ||
|
||
# Save ICD-10 lookups | ||
|
||
# The aim of this code is to prepare lists of tobacco and alcohol related diseases | ||
# with their corresponding ICD-10 codes | ||
|
||
# These data are used to search for the relevant conditions | ||
# in the process of preparing the mortality and hospitalisation rates | ||
# for use in the modelling | ||
|
||
|
||
alc_icd10_lookups <- AlcList[ , c("condition", "icd10_lookups")] | ||
|
||
alc_icd10_lookups[stringr::str_detect(condition, "Oesoph"), condition := "Oesophageal"] | ||
|
||
alc_icd10_lookups <- unique(alc_icd10_lookups, by = "icd10_lookups") | ||
|
||
usethis::use_data(alc_icd10_lookups, overwrite = T) | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.