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: Use case - Change the side bar panel elements based on the selected tab & demo conditionalPanel() function | |
Description: Powered by R, Shiny, GGPLOT2 and RStudio. | |
License: GPL-3 | |
Author: Abhinav Agrawal | |
DisplayMode: Showcase | |
Tags: R, R Shiny,TabsetPanel, ConditionalPanel | |
Type: Shiny |
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(shiny) | |
ui <- fluidPage( | |
tags$div(sliderInput("slide1", "Slider1", min = 0, max=10, value=4), style="display:inline-block"), | |
tags$div(sliderInput("slide1=2", "Slider2", min = 0, max=10, value=4), style="display:inline-block"), | |
tags$div(sliderInput("slide3", "Slider3", min = 0, max=10, value=4), style="display:inline-block") | |
) |
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
## Load required packages | |
library(plotly) | |
library(ggplot2) | |
library(shiny) | |
## Defining a key column in mtcars which will be used for event handling in event_data() | |
mtcars$key <- row.names(mtcars) | |
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(shiny) | |
ui <- fluidPage( | |
# Upload zip files | |
fileInput("file", "Upload Zip file", accept = ".zip"), | |
# action button to unzip the file | |
actionButton("unzip", "Unzip Files"), | |
# to display the metadata of the zipped file | |
tableOutput("filedf"), |
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
# Demonstration of ggcorrplot package | |
# Package created by Alboukadel Kassambara | |
# Reference link - https://cran.r-project.org/web/packages/ggcorrplot/ggcorrplot.pdf | |
# Load the required libraries | |
# install.packages("ggcorrplot") | |
library(ggcorrplot) | |
# mtcars dataset from base R used here for demonstration |
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: Use case - Demo updateselectInput() and also introducing observeEvent() function | |
Description: Powered by R, Shiny, and RStudio. | |
License: GPL-3 | |
Author: Abhinav Agrawal | |
DisplayMode: Showcase | |
Tags: R, R Shiny,updateselectInput(), observeEvent() | |
Type: Shiny |
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
#### Brief introduction to R Plotly package #### | |
# The plotly package in R is an interface to open source Javascript charting library plotly.js | |
# Plots can be created online in the plotly web GUI or offline using the plotly package | |
# Interactive plots that can be easily shared online using the plotly API/account | |
# Plotly plots can embed into R Markdown, R Shiny | |
# Tool tip feature and other controls | |
# ggplot2 graphs can be easily converted to interactive plotly objects using ggplotly() function | |
# Package documentation | |
# https://cran.r-project.org/web/packages/plotly/plotly.pdf |
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(shiny) | |
ui <- fluidPage( | |
radioButtons(inputId = "plot_type" , label = "Select the plot", choices = c("scatter", "bar", "hist" )), | |
plotOutput("myplot") | |
) | |
server <- function(input, output, session) { | |
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
# Demo example for reactiveVal with observeEvent() | |
# Create dependency on a button to reflect user input changes to the rendered output | |
library(shiny) # for Shiny components | |
library(dplyr) # for piping | |
my = mtcars %>% | |
mutate(cyl = as.factor(cyl)) | |
ui <- fluidPage( | |
h4("Demo of using reactiveVal() along with observeEvent() in R Shiny to subset data and display on click of action Button"), |
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
# Demo example for eventReactive() | |
# Create dependency on a button to reflect user input changes to the rendered output | |
# subset data on click of button and display the resultant data | |
# Load the required libraries | |
library(shiny) # for Shiny components | |
library(dplyr) # for piping and data manipulation | |
# For demo using the mtcars dataset | |
# convert the cylinder variable to factor type |
NewerOlder