Skip to content

Instantly share code, notes, and snippets.

library(shiny)
library(dygraphs)
library(quantmod)
library(shinydashboard)
sidebar <-
dashboardSidebar(
sidebarMenu(
menuItem(
"Dashboard",
---
title: "My Document"
output: html_document
params:
minimum:
label: "Minimum:"
value: 100
input: slider
min: 0
max: 1000
---
title: intro_to_R
output: html_document
---
## What is R?
R is a functional programming language for statistical computing. R has been widely adopted as the language of choice for statisticians and data scientists, and is used heavily in both academia and industry.
R is designed to be run interactively (you'll execute one line at a time) as opposed to a compiled language like C / C++ / Java.
---
output:
html_document:
toc: true
toc_float: true
code_folding: hide
params:
symbol: TSLA
---
---
title: 'Notebook: htmwlwidgets'
output:
html_notebook: default
html_document: default
---
## dygraphs
https://github.com/rstudio/dygraphs
library(sparklyr)
library(shiny)
library(leaflet)
library(readr)
library(ggplot2)
spark <- 0
if(spark){
#' Spark ML - Binary Classifier Area under ROC
#'
#' @param predicted_tbl_spark The result of running sdf_predict
#' @param label A character string specifying which column contains the true, indexed labels (0 / 1)
#' @param score A characger string specifying which column contains the scored probability of a 1
#'
#' @return The area under the ROC curve.
#' @export
---
output:
html_notebook: null
html_document: null
---
```{r setup}
library(ggplot2)
library(plotly)
library(dplyr)
# Exercise 2 - solution
library(shiny)
library(gapminder)
library(dplyr)
# Note: This code creates data sets to use in each tab.
# It removes Kuwait since Kuwait distorts the gdp scale
all_data <- filter(gapminder, country != "Kuwait")
africa_data <- filter(gapminder, continent == "Africa")
@slopp
slopp / app.R
Created October 28, 2016 19:26
library(shiny)
library(ggplot2)
library(htmltools)
ui <- fluidPage(
h2("insertUI demo"),
sidebarLayout(
sidebarPanel(
selectInput("dataset", "Pick Dataset", choices = c("mtcars", "iris"), selected = "iris"),
# This will hold column dropdowns and "Add plot" button