This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Load the package | |
library(Thresher) | |
#' Generate random data | |
set.seed(3928270) | |
ranData <- matrix(rnorm(100*12), ncol=12) | |
colnames(ranData) <- paste("G", 1:12, sep='') | |
#' Perform dim reduction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Adjust test size on a ggplot to make it visible in presentations | |
#' | |
#' Change the size of text on a \code{ggplot} so that a plot designed to look good in print is readable when included in a slide in a presentation (or vice verse) | |
#' @param g A \code{ggplot} graph | |
#' @param title_size The font size for the title, legend title and axes titles | |
#' @param text_size The font size for for the axis lables, legend text and facet text | |
#' @return A \code{ggplot} graph | |
#' @author Ella Kaye | |
#' @examples | |
#' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get packages | |
if (!require(pacman)) install.packages("pacman"); library(pacman) | |
p_load_gh("seabbs/getTBinR") | |
p_load_gh("thomasp85/patchwork") | |
p_load("tidyverse") | |
p_load("ggridges") | |
p_load("viridis") | |
## Get data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get required packages, managed via pacman | |
if (!require(pacman)) install.packages("pacman"); library(pacman) | |
p_load("getTBinR") | |
p_load("tidyverse") | |
p_load("viridis") | |
p_load("hrbrthemes") | |
p_load("ggridges") | |
p_load_gh("thomasp85/patchwork", dependencies = TRUE) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# install.packages("viridis") | |
library(viridis) | |
# install.packages("hrbrthemes") | |
library(hrbrthemes) | |
# install.packages("scales") | |
library(scales) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# install.packages("gridExtra") | |
library(gridExtra) | |
# Get the data - WHO data | |
tb_df <- get_tb_burden() | |
dict <- get_data_dict() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get the package | |
install.packages("getTBinR") | |
## Run the dashboard - if the dependencies are not installed you will be asked to install them. | |
getTBinR::run_tb_dashboard() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mapStates = map("state", fill = TRUE, plot = FALSE) | |
leaflet(data = mapStates) %>% addTiles() %>% | |
addPolygons(fillColor = topo.colors(10, alpha = NULL), stroke = FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FLOAT(SCRIPT_REAL("qbinom(0.001, .arg2, .arg1 / .arg2) / .arg2", | |
WINDOW_SUM(SUM([prob_Accepted]), -[No. of days for rolling average] + 1, 0), | |
WINDOW_SUM(COUNT([prob_Accepted]), -[No. of days for rolling average] + 1, 0))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("getTBinR") | |
library(getTBinR) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# install.packages("gridExtra") | |
library(gridExtra) | |
# Get the data | |
tb_burden <- get_tb_burden(download_data = TRUE, save = TRUE) | |
dict <- get_data_dict(download_data = TRUE, save = TRUE) |