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) | |
library(ggplot2) | |
shinyServer(function(input, output, session) { | |
if (!is.null(session$user)) { | |
data <- iris | |
p <- qplot(Sepal.Width, Sepal.Length, data = iris, color = Species) | |
output$ui <- renderUI({ | |
navbarPage( |
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) | |
library(dplyr) | |
library(lubridate) | |
# Load libraries and functions needed to create SQLite databases. | |
library(RSQLite) | |
library(RSQLite.extfuns) | |
saveSQLite <- function(data, name){ | |
path <- dplyr:::db_location(filename=paste0(name, ".sqlite")) |
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) | |
library(ggplot2) | |
# Get the current day of the month | |
dom <- 25 | |
# Define the target for salespeople in our organization. | |
salesTarget <- 15000 | |
# Set the seed so we always get the same data. |
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) | |
# Define server logic required to generate and plot a random distribution | |
shinyServer(function(input, output) { | |
# Expression that generates a plot of the distribution. The expression | |
# is wrapped in a call to renderPlot to indicate that: | |
# | |
# 1) It is "reactive" and therefore should be automatically | |
# re-executed when inputs change |
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) | |
shinyServer(function(input, output) { | |
output$distPlot <- renderPlot({ | |
print("Plotting"); | |
Sys.sleep(1) | |
# generate and plot an rnorm distribution with the requested | |
# number of observations |
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
sortListInput <- function(inputId,data) { | |
tagList( | |
singleton(tags$head(tags$script(src = "js/sortList.js"))), | |
HTML(paste(' | |
<script> | |
$(function() { | |
$( ".sortableList" ).sortable(); | |
$( ".sortableList" ).disableSelection(); | |
}); |
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) | |
shinyServer(function(input, output, session) { | |
# The number of iterations to perform | |
maxIter <- 50 | |
# Track the start and elapsed time | |
startTime <- Sys.time() | |
output$elapsed <- renderText({ |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
######### Shiny Server Pro OpenLDAP Test VM ############# | |
# This VM is based on a Ubuntu 12.04.3 x64 image. It | |
# will provision and install OpenLDAP (slapd) with the | |
# ldap-utils package and add some test data into the | |
# database. It's configured with the static IP address: |
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) | |
# Load the ggplot2 package which provides | |
# the 'mpg' dataset. | |
library(ggplot2) | |
# Define a server for the Shiny app | |
shinyServer(function(input, output) { | |
# Filter data based on selections |
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
# Define a dataset globally which will be available | |
# both to the UI and to the server. | |
# Rely on the 'WorldPhones' dataset in the datasets | |
# package (which generally comes preloaded). | |
library(datasets) | |
# Trim out the non-consecutive year from |