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
--- | |
title: "dplyr Database Example" | |
output: github_document | |
--- | |
```{r} | |
library(DBI) | |
library(RSQLite) | |
# Can be any DBI compliant database connection |
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
--- | |
title: "Untitled" | |
output: | |
flexdashboard::flex_dashboard: | |
orientation: columns | |
vertical_layout: fill | |
runtime: shiny | |
--- | |
```{r setup, include=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
snippet gg | |
ggplot(${1:data}, aes(${2:aes})) + | |
geom_${3:geom}() | |
snippet shiny | |
library(shiny) | |
ui <- fluidPage( | |
${1:ui} | |
) | |
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
--- | |
output: | |
html_document: | |
code_folding: hide | |
toc: yes | |
toc_float: yes | |
params: | |
symbol: GOOG | |
days: | |
label: "Number of Previous Days" |
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) | |
ui <- fluidPage( | |
sliderInput('x', "x", min = 0, max = 10, value = 0), | |
actionButton('go', 'Go') | |
) | |
server <- function(input, output, session) { | |
observeEvent(input$go, { | |
validate( | |
need(input$x > 5, message = "I'll never be seen!") |
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
# App requires a pachyderm pipeline with | |
# input repo "images" | |
# output repo "edges" | |
# The app assumes that pachyderm is being run locally with minikube. | |
# See: http://pachyderm.readthedocs.io/en/latest/getting_started/beginner_tutorial.html | |
# Setup ------------------------------------------------------------------- | |
library(shiny) | |
source("flickr_api.R") # file for querying flickr |
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
Sys.setenv(PATH = '/Users/Sean/.virtualenvs/r-tensorflow/bin:$PATH') | |
library(tfestimators) | |
library(readr) | |
library(stringr) | |
library(purrr) | |
col_names = c( | |
"age", "workclass", "fnlwgt", "education", "education_num", | |
"marital_status", "occupation", "relationship", "race", "gender", | |
"capital_gain", "capital_loss", "hours_per_week", "native_country", |
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) | |
ui <- fluidPage( | |
textOutput("height"), | |
tags$script(' | |
$(window).bind("resize", function () { | |
Shiny.onInputChange("height", $(document).height()); | |
});' |
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
/** | |
* Call plumber API with id to return profile | |
* | |
* @param {number} id The customer id | |
* @param {string} key API Key | |
* @customfunction | |
*/ | |
function getProfileFromPlumber(id, key) { | |
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(parallel) | |
library(processx) | |
# config | |
t.test <- 120 | |
n.processes <- 12 | |
t.update <- 10 | |
# storage |