Skip to content

Instantly share code, notes, and snippets.

@jtag04
jtag04 / reactive plotly.rmd
Last active March 27, 2019 05:18
Remaking Carson Sievert's updating a reactive plotly chart example
---
title: "dash"
output: flexdashboard::flex_dashboard
runtime: shiny
---
```{r setup, include=FALSE}
library(tidyverse)
@jtag04
jtag04 / reactive shiny input options.rmd
Created March 27, 2019 05:22
I am trying to make mutually reactive shiny input (in a flexdashboard)
---
title: "reactive test"
output:
flexdashboard::flex_dashboard
runtime: shiny
---
```{r}
library(tidyverse)
```
@jtag04
jtag04 / new_reactive filters flexdashboard
Created March 29, 2019 06:04
mutually dynamic filters for R Shiny Flexdashboard
---
title: "reactive test"
output:
flexdashboard::flex_dashboard
runtime: shiny
---
```{r}
library(tidyverse)
```
## Preliminaries ----
## Load Packages
library(tidyverse)
library(lubridate)
library(here)
library(readxl)
## Specify the folder ----
FolderMaster <- here::here("Official Results")
get_data_ready <- function(data) {
data %>%
mutate(response_rank = as.numeric(response)) %>%
mutate(total_levels = length(response_values),
levels_are_even = length(response_values) %% 2 == 0,
middle_level = if_else(!levels_are_even, ceiling(length(response_values)/2), NULL)) %>%
mutate(response_rank_type = if_else(!levels_are_even,
prep_for_chart <- function(data) {
data %>%
arrange(response_rank) %>%
group_by(question, response_rank_type) %>%
mutate(lead1 = lead(sum_of_value),
lead2 = lead(sum_of_value, 2),
lag1 = lag(sum_of_value),
lag2 = lag(sum_of_value,2)) %>%
ungroup() %>%
header_cells <- c("SEEK Job Mail",
"Hi Julian",
"tableau in Melbourne",
"posted yesterday match your Saved Search:",
"new jobs. Update your SEEK Profile",
"Manage your Saved Searches and subscription preferences",
"https://www.seek.com.au/my-activity/saved-search",
"SEEK Profile Link",
"Update your SEEK Profile")
radioButtons("brand",
"brand:",
choices = c("All", unique(candyData$Brand)),
selected = "All")
radioButtons("candy_name",
"candy_name:",
choices = c("All", unique(candyData$Candy)),
selected = "All")
---
title: "dash"
output: flexdashboard::flex_dashboard
runtime: shiny
---
```{r setup, include=FALSE}
library(tidyverse)
library(lubridate)
library(plotly)
```
search_data_frame <- completed %>%
filter(country == "AU",
certificate_name == "Tableau Desktop Certified Associate") %>%
distinct(Full_name) %>%
mutate(search_terms = paste("LINKEDIN", Full_name, sep = " "),
search_url = paste("https://www.google.com.au/search?q=", gsub(" ", "+", search_terms), sep = "")) %>%
mutate(urls = map(search_url, ~ xml2::read_html(.x) %>%
rvest::html_nodes(xpath='//h3/a') %>%
rvest::html_attr('href') %>%
strsplit(.[as.vector(grep("url",.))], split = "&") %>%