-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
72 lines (49 loc) · 2.91 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
output: github_document
header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}
\includegraphics[width=2in,height=2in]{man/figures/logo.png}\LARGE\\}
- \posttitle{\end{center}}
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
```
# Estimating the smoke-free dividend <img src="hex-smkfreediv2.png" align="right" style="padding-left:10px;background-color:white;" width="100" height="100"/>
<!-- badges: start -->
[![Project Status: WIP -- Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
<!-- badges: end -->
## Motivation
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)](https://tobaccocontrol.bmj.com/content/early/2024/02/05/tc-2023-058264), which should be cited with any use of this code.
## Usage
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`](https://github.com/ropensci/fingertipsR).
```{r fingertips, eval = FALSE }
# 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')
```
## Installation
`smkfreediv2` is available on GitHub. If you are on a Windows machine you will also need to [install Rtools](https://www.rdocumentation.org/packages/installr/versions/0.22.0/topics/install.Rtools).\
Once that is sorted, you can install the latest version or a specified version from GitHub with:
```{r gh_installation, message=FALSE, eval = FALSE}
#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
)
```
## Reference
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