This file contains 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
## ------------------------------------------------------------------------------------------------------------------- | |
library(tidyverse) | |
#remotes::install_github("hrbrmstr/cdcfluview") | |
library(cdcfluview) | |
library(MMWRweek) | |
library(tidyverse) | |
library(plotly) | |
library(gganimate) | |
This file contains 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
reprex::reprex({ | |
library(tidyverse) | |
## define the example tibble | |
dat <- | |
tribble( | |
~individual, ~Q1_A, ~Q1_B, ~Q1_C, ~Q1_D, ~Q2_A, ~Q2_B, ~Q2_C, ~Q2_D, | |
"alice", NA, "cat", NA, NA, "tacos", NA, NA, NA, | |
"bob", "dog", NA, NA, NA, NA, NA, NA, "pizza" |
This file contains 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
############################################################################### | |
## brief demo of anomaly detection in R using the timetk anomalize() function | |
## current as of 2024-05-13 | |
############################################################################### | |
## set up | |
## load dplyr for data manipulation | |
library(dplyr) | |
## load timetk for anomaly detection functionality | |
library(timetk) | |
## load jsonlite to read in example data |
This file contains 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
############################################################################### | |
## brief demo of exploratory data analysis (EDA) tools for data frames in R | |
## NOTE: the code below is intended to preview the EDA tools ... | |
## ... it does not exhaustively demonstrate functionality for these tools ... | |
## ... and it is current as of 2024-04-09 ... | |
## ... for more information refer to the documentation for each package | |
############################################################################### | |
############################################################################### | |
## set up |
This file contains 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
library(microbenchmark) | |
library(redux) | |
library(svSocket) | |
# clear workspace | |
rm(list = ls()) | |
# set up svSocket | |
startSocketServer() | |
con <- socketConnection(host = "localhost", port = 8888, blocking = FALSE) |
This file contains 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
library(ggplot2) | |
library(tidyr) | |
dat <- data.frame(x = rnorm(n = 1000, mean = 2.8, sd = 0.05), | |
y1 = sample(64503:73034, size = 1000, replace = TRUE), | |
y2 = sample(18738:19602, size = 1000, replace = TRUE)) | |
dat %>% | |
ggplot() + | |
geom_point(aes(x,y1)) + |
This file contains 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
# script to demonstrate outbreak animation with a subset of mers_korea_2015 data | |
# must install github release of threejs package | |
# devtools::install_github("bwlewis/rthreejs") | |
library(threejs) | |
library(outbreaks) | |
library(dplyr) | |
# use dplyr to subset results to only include hospital visit exposure |
This file contains 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("babynames") | |
library(babynames) | |
# install.packages("tidyverse") | |
library(tidyverse) | |
# install.packages("ggplot2") | |
# install.packages("dplyr") | |
# let's take a look at the data | |
babynames %>% | |
View() |
This file contains 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
# script to demonstrate outbreak animation with a subset of mers_korea_2015 data | |
# must install github release of threejs package | |
# devtools::install_github("bwlewis/rthreejs") | |
library(threejs) | |
library(outbreaks) | |
library(dplyr) | |
# use dplyr to subset results to only include hospital visit exposure |
This file contains 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
library(shiny) | |
options(shiny.reactlog=TRUE) | |
# define home dir for shiny app | |
homed <- getwd() | |
# set up choices to be retrievable in server.R | |
progchoices <- c("This is a TEST APP" = "testapp/", | |
"Yet Another Program" = "anotherprog/") | |
ui <- fluidPage( |
NewerOlder