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)({ | |
# x contains all the observations of the x variable selected by the user. X is a reactive function | |
x <- reactive({ | |
iris[,as.numeric(input$var1)] | |
}) | |
# x contains all the observations of the y variable selected by the user. Y is a reactive function | |
y <- reactive({ | |
iris[,as.numeric(input$var2)] | |
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(leaflet) | |
shinyServer(function(input, output, session){ | |
output$mymap <- renderLeaflet({ | |
# Classifying the type of earthquake based on magnitude | |
quakes$type = ifelse((quakes$mag >= 4 & quakes$mag <= 4.9), "Light [4-4.9]", | |
ifelse((quakes$mag >= 5 & quakes$mag <= 5.9), "Moderate [5-5.9]", | |
ifelse((quakes$mag >= 6 & quakes$mag <= 6.9), "Strong [6-6.9]", | |
ifelse((quakes$mag >= 7 & quakes$mag <= 7.9), "Major [7-7.9]", "Great" | |
)))) |
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(data.table) | |
# use the below options code if you wish to increase the file input limit, | |
# in this example file input limit is increased from 5MB to 9MB | |
options(shiny.maxRequestSize = 700*1024^2) | |
shinyServer(function(input,output){ | |
# This reactive function will take the inputs from UI.R and use them for read.table() to read the data from the file. It returns the dataset in the form of a dataframe. | |
# file$datapath -> gives the path of the file |
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(googleVis) | |
shinyServer(function(input, output, session){ | |
output$bubble <- renderGvis({ | |
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)({ | |
# x contains all the observations of the x variable selected by the user. X is a reactive function | |
x <- reactive({ | |
iris[,as.numeric(input$var1)] | |
}) | |
# x contains all the observations of the y variable selected by the user. Y is a reactive function | |
y <- reactive({ | |
iris[,as.numeric(input$var2)] |
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){ | |
observe( | |
{input$Year | |
# Update based on the year change event | |
updateSelectInput(session, "Month", "Month", choices = data$Month[data$Year==input$Year]) | |
} | |
) | |
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){ | |
}) |
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) { | |
# Split the elements input from the user | |
v <- reactive({ | |
as.numeric(unlist(strsplit(input$vec1,","))) | |
}) | |
# Print a message just before printing the vector values |
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: Multiple Action Button Demo - An attempt to button event based navigation/actions. Powered by R, Shiny and Rstudio. | |
License: GPL-3 | |
Author: Abhinav Agrawal | |
DisplayMode: Showcase | |
Tags: action button, R, R Shiny | |
Type: Shiny |
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: Multiple Action Button Demo - Example # 2 | |
Description: An attempt to button event based navigation/actions. Powered by R, Shiny and Rstudio. | |
License: GPL-3 | |
Author: Abhinav Agrawal | |
DisplayMode: Showcase | |
Tags: action button, R, R Shiny | |
Type: Shiny |