-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfentanyl_supply_analysis_v2.Rmd
More file actions
45 lines (37 loc) · 1.25 KB
/
fentanyl_supply_analysis_v2.Rmd
File metadata and controls
45 lines (37 loc) · 1.25 KB
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
---
title: "Fentanyl in the drug supply"
output: html_notebook
---
```{r setup, include=FALSE}
library(tidyverse)
library(lubridate)
library(patchwork)
library(geofacet)
library(readxl)
library(ggpubr)
library(svglite)
library(zoo)
library(grid)
```
```{r specify shared settings, load functions and data}
## Define shared settings
dat_folder <- "C:/Data/NFLIS/Raw"
dat_years <- 2013:2023
update_raw_data <- FALSE # Only needed if raw data files have changed
update_clean_data <- FALSE # Only needed if categories or sample restrictions have changed
update_analysis <- FALSE # Need data folder access to update analysis, otherwise set to `FALSE`
druglist <- c("Methamphetamine", "Cannabinoids", "Cocaine", "Heroin", "Prescription opioids",
"Prescription benzodiazepines", "Prescription stimulants", "Hallucinogens", "Club drugs")
fig_ext <- "tiff"
datestring <- format(Sys.time(), "%Y%m%d")
## Clean and load data
source("./auxiliary/NFLIS_data_cleaning.R")
```
```{r calculate yearly and monthly trends}
source("./auxiliary/calculate_trends.R")
# Generate descriptive statistics and sample restrictions figure
source("./auxiliary/descriptive_statistics.R")
```
```{r plot figures & tabulate rankings}
source("./auxiliary/plot_trends_polished.R")
```