The motivation for smkfreediv2
is to develop a set of standard
functions for obtaining and processing raw data from OHID local tobacco
profiles and combining this with data from the Smoking Toolkit Study
(STS) to produce estimates of the smoke-free dividend for local
authorities in England.
The package uses the methods developed in Morris et al. (2024), which should be cited with any use of this code.
The smkfreediv2
package contains functions which read in raw data
files, process them into clean output variables, and combines all data
files into a single output data table. The inputs are the raw
Smoking Toolkit Study (STS) data files in SPSS data format.
The package uses data on smoking prevalence from the Office for Health
Improvement and Disparities (OHID) local tobacco profiles. The functions
in the package download these data using a separate R package. To use
smkfreediv2
you will also need to install
fingertipsR
.
# Enable repository from ropensci
options(repos = c(
ropensci = 'https://ropensci.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))
# Download and install fingertipsR in R
install.packages('fingertipsR')
smkfreediv2
is available on GitHub. If you are on a Windows machine
you will also need to install
Rtools.
Once that is sorted, you can install the latest version or a specified
version from GitHub with:
#install.packages("devtools")
#install.packages("getPass")
#install.packages("git2r")
devtools::install_git(
"https://github.com/STAPM/smkfreediv2.git",
ref = "x.x.x",
build_vignettes = TRUE
)
Morris D, Gillespie D, Dockrell MJ, et al. Potential smoke-free dividend across local areas in England: a cross-sectional analysis Tobacco Control Published Online First: 20 March 2024. doi: 10.1136/tc-2023-058264