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
#' Build a Histogram | |
#' | |
#' Computes bins server side and creates the histogram inside R. | |
#' | |
#' @param data A Spark DataFrame (tbl_spark). | |
#' @param x Quoted name of column to use in the plot. | |
#' @param bins Number of bins to use. Defaults to 30. | |
#' @param output Type of plot returned. Current options are: "ggplot", "ggvis" & "shiny". The option "data" returns a data.frame. | |
#' @export | |
server_histogram <- function( |
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
--- | |
title: "Stock Presentation" | |
output: ioslides_presentation | |
params: | |
stock: GOOG | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = FALSE); knitr::opts_chunk$set(warning = FALSE) #-- Hide code and messages | |
library(magrittr); library(dygraphs) #-- Load needed libraries |
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
# The following two commands remove any previously installed H2O packages for R. | |
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } | |
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } | |
# Next, we download packages that H2O depends on. | |
pkgs <- c("methods","statmod","stats","graphics","RCurl","jsonlite","tools","utils") | |
for (pkg in pkgs) { | |
if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) } | |
} |
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
# The following two commands remove any previously installed H2O packages for R. | |
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } | |
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } | |
# Next, we download packages that H2O depends on. | |
pkgs <- c("methods","statmod","stats","graphics","RCurl","jsonlite","tools","utils") | |
for (pkg in pkgs) { | |
if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) } | |
} |
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
devtools::install_github("rstats-db/odbc", ref = "transactions", force = TRUE) | |
library(odbc) | |
odbcHiveCon <- dbConnect(odbc(), | |
Driver = "Hive Driver", | |
host = "ec2-52-35-222-37.us-west-2.compute.amazonaws.com", | |
Schema = "default", | |
UID = "rstudio", | |
PWD = "rstudio", | |
port = 10000) |
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(shinydashboard) | |
library(dplyr) | |
library(dbplyr) | |
library(purrr) | |
library(shiny) | |
library(highcharter) | |
library(DT) | |
library(htmltools) | |
# Use the `config` package to get the credentials |
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(shinydashboard) | |
library(dplyr) | |
library(dbplyr) | |
library(purrr) | |
library(shiny) | |
library(highcharter) | |
library(DT) | |
library(htmltools) | |
# Use the `config` package to get the credentials |
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(shinydashboard) | |
library(dplyr) | |
library(dbplyr) | |
library(purrr) | |
library(shiny) | |
library(highcharter) | |
library(DT) | |
library(htmltools) | |
library(nycflights13) |
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(tfestimators) | |
library(titanic) | |
library(dplyr) | |
library(purrr) | |
titanic_set <- titanic_train %>% | |
filter(!is.na(Age)) |
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(dplyr) | |
con <- DBI::dbConnect(RSQLite::SQLite(), path = ":memory:") | |
db_mtcars <- copy_to(con, mtcars) | |
DBI::dbListTables(con) | |
db_mtcars %>% | |
filter(am == 1) %>% | |
show_query() |
OlderNewer