-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
81 lines (58 loc) · 2.5 KB
/
README.Rmd
File metadata and controls
81 lines (58 loc) · 2.5 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
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
73
74
75
76
77
78
79
80
---
title: "R custom functions"
subtitle: "Definition and description of R custom functions for various scripts"
author: Kevin C Yang
date: "`r format(Sys.Date(), '%B %d, %Y')`"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = T, message = F)
```
# Essential libraries
A list of essential libraries is also necessary, so these have been compiled, with continuous updates, to be sourced using a single script.
Note that currently, the checkpoint package is used to install and load packages from the Microsoft R Application Network (MRAN), which stores daily snapshots from CRAN. This approach ensures that the packages loaded and installed have consistent versions therefore guarantees reproducibility. However, MRAN and checkpoint will be retired as of July 2023, so an alternative route will be needed.
```{r}
source("EssentialLibraries.R")
```
The list of essential libraries are:
* Core libraries
+ tidyverse v`r packageVersion("tidyverse")`
* Data access
+ olapR v`r packageVersion("olapR")`
+ RODBC v`r packageVersion("RODBC")`
+ readxl v`r packageVersion("readxl")`
* Data wrangling
+ reshape2 v`r packageVersion("reshape2")`
+ lubridate v`r packageVersion("lubridate")`
+ magrittr v`r packageVersion("magrittr")`
* Data visualization
+ ggpubr v`r packageVersion("ggpubr")`
+ RColorBrewer v`r packageVersion("RColorBrewer")`
+ viridis v`r packageVersion("viridis")`
+ flextable v`r packageVersion("flextable")`
* Data output
+ openxlsx v`r packageVersion("openxlsx")`
# PHRDWquery functions
A few functions have been developed for the needs to easily pull data from the Public Health Reporting Data Warehouse (PHRDW). These functions have been compiled into a script where sourcing the script simply loads in the functions.
```{r}
source("PHRDWquery.R")
```
## `PHRDW_getCodes()`
`PHRDW_getCodes()` retreives a list of available order and test codes from one of the Enteric, LADW, Respiratory, or STIBBI PHRDW mart.
## `PHRDW_pullResults()`
`PHRDW_pullResults()` pulls a line list from a particular PHRDW mart. The fields pulled by default include personal information and results. Parameters can be defined to filter the pulled data for a particular test code, etc.
Currently the available parameters are:
* mart
* collectiondate_start = NULL
* collectiondate_end = NULL
* orderdate_start = NULL
* orderdate_end = NULL
* additional_fields = NULL
* testcode = NULL
* proficiency = NULL
* testperformed = T
* criteria = NULL
# Session Info
```{r}
sessionInfo()
```