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
# From https://stats.stackexchange.com/questions/224045/using-lm-for-2-sample-proportion-test | |
## prop.test gives pooled 2-sample proportion result | |
## glm w/ binomial family gives unpooled 2-sample proportion result | |
## lm and glm w/ gaussian family give unknown result | |
library(dplyr) | |
library(broom) | |
set.seed(12345) |
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
# An example based on http://shiny.rstudio.com/articles/dynamic-ui.html | |
library(shiny) | |
ui = basicPage( | |
fluidRow( | |
actionButton(inputId = "add_buttons", label = "Add 5 Buttons") | |
), | |
uiOutput("more_buttons") # this is where the dynamically added buttons will go | |
) |
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
# An example based on http://shiny.rstudio.com/articles/dynamic-ui.html | |
library(shiny) | |
ui = basicPage( | |
fluidRow( | |
actionButton(inputId = "add_buttons", label = "Add 5 Buttons") | |
), | |
uiOutput("more_buttons") # this is where the dynamically added buttons will go. | |
) |
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
# Could this be an alternative solution for the following? | |
# https://github.com/jcheng5/rstudio2017-shiny-workshop/blob/master/apps/reactivity/cranlogs.solution.R | |
library(cranlogs) | |
library(dplyr) | |
library(lubridate) | |
library(ggplot2) | |
library(shiny) | |
# Define UI for specifying package and plotting cranlogs ------------ |
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) | |
library(ggplot2) | |
dataset <- diamonds | |
ui <- pageWithSidebar( | |
headerPanel("Diamonds Explorer"), | |
sidebarPanel( |
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) | |
library(ggplot2) | |
## Pre-app calculations | |
# Get the current day of the month | |
dom <- 25 | |
# Define the target for salespeople in our organization. | |
salesTarget <- 15000 |
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
# Fit model with parallel lines (main effects only) | |
m_pr <- lm(log(price) ~ Surface + factor(artistliving), data = pp_Surf_lt_5000) | |
## Option 1 | |
# Save regression coefficients in a tibble | |
m_pr_coefs <- m_pr %>% | |
tidy() %>% | |
select(term, estimate) |
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) | |
# list col for age -------------------------------------------------- | |
df_listcol <- tibble( | |
age = list(30, 40, 50, 55, "65+") | |
) | |
typeof(df_listcol$age) | |
#> [1] "list" |
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) | |
library(rtweet) | |
library(glue) | |
tml <- get_timelines("CostcoRiceBag", n = 3200) | |
br <- tml %>% | |
filter(is.na(reply_to_screen_name)) %>% | |
slice( | |
which(str_detect(text, "IS IT JUST ME")): |
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
# Load packages ---------------------------------------------------------------- | |
library(shiny) | |
library(shinythemes) | |
library(ggplot2) | |
library(dplyr) | |
library(fiftystater) | |
library(tools) | |
library(mapproj) | |
library(fontawesome) |
OlderNewer