Skip to content

Commit

Permalink
fix issue with 54 instead of 52 tob disease names
Browse files Browse the repository at this point in the history
  • Loading branch information
dosgillespie committed Nov 25, 2020
1 parent f40146b commit bdde600
Show file tree
Hide file tree
Showing 47 changed files with 93 additions and 81 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tobalcepi
Type: Package
Title: Risk Functions and Attributable Fractions for Tobacco and Alcohol
Version: 1.2.0
Version: 1.2.1
Authors@R:
c(
person(given = "Duncan",
Expand Down Expand Up @@ -41,7 +41,9 @@ Imports:
readxl,
testthat,
dplyr,
data.table
data.table,
Rdpack
RdMacros: Rdpack
VignetteBuilder: knitr
RoxygenNote: 7.1.0
Depends:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(TobLags)
export(WArisk_acute)
export(subgroupRisk)
import(data.table)
importFrom(Rdpack,reprompt)
importFrom(data.table,":=")
importFrom(data.table,setDT)
importFrom(data.table,setnames)
2 changes: 1 addition & 1 deletion R/AlcBinge.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#'
#' Designed to work with cross-sectional survey data with a wide range of individual-level covariates.
#' Uses survey data and previously estimated coefficients to describe
#' the patterns of single occassion drinking.
#' the patterns of single occasion drinking.
#'
#' This is based on a study by Hill-McManus 2014,
#' who analysed drinking occasions using data from detailed diaries in the National Diet and Nutrition Survey 2000/2001.
Expand Down
12 changes: 5 additions & 7 deletions R/tob_disease_names.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

#' Names of tobacco-related diseases
#'
#'
#' @importFrom Rdpack reprompt
#'
#' @docType data
#'
#' @format A data table
#'
#' @source
#'
#'
#'
#' @format A character vector containing the names of the 52 disease categories
#' of smoking related diseases \insertCite{webster2018risk;textual}{tobalcepi}.
#'
#' @references
#' \insertRef{webster2018risk}{tobalcepi}
#'
"tob_disease_names"
12 changes: 5 additions & 7 deletions R/tobacco_relative_risks.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

#' Tobacco relative risks
#'
#'
#' @importFrom Rdpack reprompt
#'
#' @docType data
#'
#' @format A data table
#'
#' @source
#'
#'
#'
#' @format A data table containing the relative risks of 52 disease categories
#' for current vs. never smokers \insertCite{webster2018risk;textual}{tobalcepi}.
#'
#' @references
#' \insertRef{webster2018risk}{tobalcepi}
#'
"tobacco_relative_risks"
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
output: github_document
bibliography: disease-risks.bib
bibliography: inst/REFERENCES.bib
link-citations: yes
citation_package: natbib
biblio-style: vancouver
Expand Down Expand Up @@ -29,7 +29,7 @@ The motivation for `tobalcepi` was to organise how we store, process and use the
`tobalcepi` was created as part of a programme of work on the health economics of tobacco and alcohol at the School of Health and Related Research (ScHARR), The University of Sheffield. This programme is based around the development of the Sheffield Tobacco and Alcohol Policy Modelling (STAPM), which aims to use comparable methodologies to evaluate the impacts of tobacco and alcohol policies, and investigate the consequences of clustering and interactions between tobacco and alcohol consumption behaviours.

## Relative risk data
The disease lists and risk functions in this package all have published sources, which we have referenced. We store the master files for our tobacco and alcohol disease lists and risk functions sources in the University of Sheffield folder `X:/ScHARR/PR_Disease_Risk_TA/Disease_Lists`. In order to obtain mathematical descriptions of the risk functions for use in modelling, we needed to contact some authors to ask for additional information.
The disease lists and risk functions in this package all have published sources, which we have referenced. We store the master files for our tobacco and alcohol disease lists and risk functions sources in the University of Sheffield folder `X:/ScHARR/PR_Disease_Risk_TA/Code/tables`. In order to obtain mathematical descriptions of the risk functions for use in modelling, we needed to contact some authors to ask for additional information.

### Alcohol
The high-level function for alcohol is `tobalcepi::RRalc()`, which calculates individual risks of diseases as follows:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The disease lists and risk functions in this package all have published
sources, which we have referenced. We store the master files for our
tobacco and alcohol disease lists and risk functions sources in the
University of Sheffield folder
`X:/ScHARR/PR_Disease_Risk_TA/Disease_Lists`. In order to obtain
`X:/ScHARR/PR_Disease_Risk_TA/Code/tables`. In order to obtain
mathematical descriptions of the risk functions for use in modelling, we
needed to contact some authors to ask for additional information.

Expand Down
5 changes: 0 additions & 5 deletions data-raw/disease_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ library(readxl)
# Set the file path to point to the University of Sheffield X drive
root_dir <- "/Volumes/"

# Load the master spreadsheet containing disease risks
TobList <- readxl::read_excel(paste0(root_dir, "ScHARR/PR_Disease_Risk_TA/Code/tables/16102018tobaccoandalcoholDiseaseListandRiskFunctions.xlsx"), sheet = "Tobacco")

tob_disease_names <- as.character(c(unique(TobList$condition)))

usethis::use_data(tob_disease_names, overwrite = T)



Expand Down
14 changes: 12 additions & 2 deletions data-raw/tobacco_relative_risks.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# This code reads and processes the relative risks for tobacco
# They are stored in X:/ScHARR/PR_Disease_Risk_TA/Code/tables
# for current vs. never smokers

# They are stored in a master spreadsheet in X:/ScHARR/PR_Disease_Risk_TA/Code/tables
# `16102018 tobacco and alcohol Disease List and Risk Functions.xlsx`

# This code reads that file and cleans it to prepare the data to be used in the model

Expand All @@ -10,7 +13,9 @@ library(readxl)
root_dir <- "/Volumes/"

# Load the master spreadsheet containing disease risks
tobacco_relative_risks <- readxl::read_excel(paste0(root_dir, "ScHARR/PR_Disease_Risk_TA/Code/tables/16102018tobaccoandalcoholDiseaseListandRiskFunctions.xlsx"), sheet = "Tobacco")
tobacco_relative_risks <- readxl::read_excel(paste0(root_dir,
"ScHARR/PR_Disease_Risk_TA/Code/tables/16102018tobaccoandalcoholDiseaseListandRiskFunctions.xlsx"),
sheet = "Tobacco")

# Set it as a data table
data.table::setDT(tobacco_relative_risks)
Expand All @@ -25,3 +30,8 @@ data.table::setnames(tobacco_relative_risks, "Current", "relative_risk")
# Save the result to the package data folder
usethis::use_data(tobacco_relative_risks, overwrite = T)

# Save a separate list of the disease names
tob_disease_names <- as.character(c(unique(tobacco_relative_risks$condition)))

usethis::use_data(tob_disease_names, overwrite = T)

Binary file modified data/tob_disease_names.rda
Binary file not shown.
Binary file modified data/tobacco_relative_risks.rda
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion man/AlcBinge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/tob_disease_names.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/tobacco_relative_risks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/articles/alc_partially_attrib_acute.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/articles/alc_wholly_attrib_acute.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/articles/alc_wholly_attrib_chronic.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/articles/smoking-disease-risks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions public/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ articles:
alc_wholly_attrib_acute: alc_wholly_attrib_acute.html
alc_wholly_attrib_chronic: alc_wholly_attrib_chronic.html
smoking-disease-risks: smoking-disease-risks.html
last_built: 2020-11-25T11:12Z
last_built: 2020-11-25T11:48Z
urls:
reference: https://stapm.gitlab.io/tobalcepi/reference
article: https://stapm.gitlab.io/tobalcepi/articles
Expand Down
6 changes: 3 additions & 3 deletions public/reference/AlcBinge.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/AlcBinge_stapm.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/AlcLags.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/ExpandCodes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/PArisk.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/RRFunc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/RRTobDR.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/RRalc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/reference/RRtob.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdde600

Please sign in to comment.