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(c("tidyverse","DT","shinythemes", "shiny")) |
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
ENTRY_DATE %within% new_interval(min_time, max_time) |
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
library(magrittr) | |
library(tidyr) | |
library(dplyr) | |
library(ggplot2) | |
data <- data.frame(PT_ID = c(23, 23, 23, 23, 100, 100, 100, 100), | |
DATETIME = c("1/1/2013 9:38", "8/9/2014 15:42", "1/1/2013 9:38", "8/9/2014 15:42", "12/21/2011 12:10", "8/9/2013 11:18", "12/21/2011 12:10", "8/9/2013 11:18"), | |
MoCA_total = c("MHSMOCA:MOCATOTAL = 25", "MHSMOCA:MOCATOTAL = 22", NA, NA, "MHSMOCA:MOCATOTAL = 21", "MHSMOCA:MOCATOTAL = 25", NA, NA), | |
Total_Correct = c(NA, NA, "MHSWLM:CORRECT = 15", "MHSWLM:CORRECT = 20", NA, NA, "MHSWLM:CORRECT = 18", "MHSWLM:CORRECT = 24")) %>% tbl_df() |
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
library(magrittr) | |
library(tidyr) | |
library(dplyr) | |
data <- data.frame(Var1 = c("MHSMOCA:MOCATOTAL = 24", "MHSMOCA:MOCATOTAL = 24.5","MHSMOCA:MOCA7TOTAL = 24")) %>% tbl_df() | |
# Option 1: Use a variable splitting function from tidyr | |
## tidyr::separate takes the column you want to split on, what you want the new column names to be, what the separating text is, and whether you want to change data types after separation (so here rendering the number as a dbl or int) | |
data %>% | |
separate(col = Var1, into = c("Text","Number"), sep = "=", convert = 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
# Load helpful packages | |
library(lubridate) | |
library(dplyr) | |
# Sample Data | |
data <- structure(list(X1 = c("kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov","kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "atl1.america.net", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "atl1.america.net", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kenneth.lerc.nasa.gov", "kennet |
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
library(shiny) | |
shinyServer(function(input, output){ | |
library(dplyr) | |
library(tidyr) | |
input_model <- eventReactive(input$calc, { | |
data.frame(Age = input$age, | |
Race = input$race, | |
VKORC1 = input$vkorc1, |
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
library(ggplot2) | |
library(scales) | |
library(dplyr) | |
library(stringr) | |
arl <- read.csv(file = "index13.csv",header = TRUE,skip = 1) %>% | |
tbl_df() %>% ## turn into tbl_df | |
select(Institution = Institution.Name.1, | |
Total = Total.Library.Expenditures, | |
Salaries = Salaries...Wages.Professional.Staff, |