Skip to content

Instantly share code, notes, and snippets.

# 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) }
}
---
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
@edgararuiz-zz
edgararuiz-zz / serverplot.R
Created January 21, 2017 17:15
Histogram function
#' 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(