-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 438536a
Showing
207 changed files
with
454,852 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Title: Hello Shiny! | ||
Author: RStudio, Inc. | ||
AuthorUrl: http://www.rstudio.com/ | ||
License: MIT | ||
DisplayMode: Showcase | ||
Tags: getting-started | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This small Shiny application demonstrates Shiny's automatic UI updates. | ||
|
||
Move the *Number of bins* slider and notice how the `renderPlot` expression is automatically re-evaluated when its dependant, `input$bins`, changes, causing a histogram with a new number of bins to be rendered. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
library(shiny) | ||
|
||
# Define UI for app that draws a histogram ---- | ||
ui <- fluidPage( | ||
|
||
# App title ---- | ||
titlePanel("Hello Shiny!"), | ||
|
||
# Sidebar layout with input and output definitions ---- | ||
sidebarLayout( | ||
|
||
# Sidebar panel for inputs ---- | ||
sidebarPanel( | ||
|
||
# Input: Slider for the number of bins ---- | ||
sliderInput(inputId = "bins", | ||
label = "Number of bins:", | ||
min = 1, | ||
max = 50, | ||
value = 30) | ||
|
||
), | ||
|
||
# Main panel for displaying outputs ---- | ||
mainPanel( | ||
|
||
# Output: Histogram ---- | ||
plotOutput(outputId = "distPlot") | ||
|
||
) | ||
) | ||
) | ||
|
||
# Define server logic required to draw a histogram ---- | ||
server <- function(input, output) { | ||
|
||
# Histogram of the Old Faithful Geyser Data ---- | ||
# with requested number of bins | ||
# This expression that generates a histogram is wrapped in a call | ||
# to renderPlot to indicate that: | ||
# | ||
# 1. It is "reactive" and therefore should be automatically | ||
# re-executed when inputs (input$bins) change | ||
# 2. Its output type is a plot | ||
output$distPlot <- renderPlot({ | ||
|
||
x <- faithful$waiting | ||
bins <- seq(min(x), max(x), length.out = input$bins + 1) | ||
|
||
hist(x, breaks = bins, col = "#75AADB", border = "white", | ||
xlab = "Waiting time to next eruption (in mins)", | ||
main = "Histogram of waiting times") | ||
|
||
}) | ||
|
||
} | ||
|
||
# Create Shiny app ---- | ||
shinyApp(ui = ui, server = server) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"name":"app.R","content":"library(shiny)\n\n# Define UI for app that draws a histogram ----\nui <- fluidPage(\n\n # App title ----\n titlePanel(\"Hello Shiny!\"),\n\n # Sidebar layout with input and output definitions ----\n sidebarLayout(\n\n # Sidebar panel for inputs ----\n sidebarPanel(\n\n # Input: Slider for the number of bins ----\n sliderInput(inputId = \"bins\",\n label = \"Number of bins:\",\n min = 1,\n max = 50,\n value = 30)\n\n ),\n\n # Main panel for displaying outputs ----\n mainPanel(\n\n # Output: Histogram ----\n plotOutput(outputId = \"distPlot\")\n\n )\n )\n)\n\n# Define server logic required to draw a histogram ----\nserver <- function(input, output) {\n\n # Histogram of the Old Faithful Geyser Data ----\n # with requested number of bins\n # This expression that generates a histogram is wrapped in a call\n # to renderPlot to indicate that:\n #\n # 1. It is \"reactive\" and therefore should be automatically\n # re-executed when inputs (input$bins) change\n # 2. Its output type is a plot\n output$distPlot <- renderPlot({\n\n x <- faithful$waiting\n bins <- seq(min(x), max(x), length.out = input$bins + 1)\n\n hist(x, breaks = bins, col = \"#75AADB\", border = \"white\",\n xlab = \"Waiting time to next eruption (in mins)\",\n main = \"Histogram of waiting times\")\n\n })\n\n}\n\n# Create Shiny app ----\nshinyApp(ui = ui, server = server)\n","type":"text"},{"name":"DESCRIPTION","content":"Title: Hello Shiny!\nAuthor: RStudio, Inc.\nAuthorUrl: http://www.rstudio.com/\nLicense: MIT\nDisplayMode: Showcase\nTags: getting-started\nType: Shiny\n","type":"text"},{"name":"Readme.md","content":"This small Shiny application demonstrates Shiny's automatic UI updates. \n\nMove the *Number of bins* slider and notice how the `renderPlot` expression is automatically re-evaluated when its dependant, `input$bins`, changes, causing a histogram with a new number of bins to be rendered.\n","type":"text"}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | ||
<head> | ||
<title>Redirect to editable app</title> | ||
<meta | ||
http-equiv="refresh" | ||
content="0;URL='../index.html?_shinylive-mode=editor-terminal-viewer'" | ||
/> | ||
</head> | ||
<body></body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Shiny App</title> | ||
<script | ||
src="./shinylive/load-shinylive-sw.js" | ||
type="module" | ||
></script> | ||
<script type="module"> | ||
import { runExportedApp } from "./shinylive/shinylive.js"; | ||
runExportedApp({ | ||
id: "root", | ||
appEngine: "r", | ||
relPath: "", | ||
}); | ||
</script> | ||
<link rel="stylesheet" href="./shinylive/style-resets.css" /> | ||
<link rel="stylesheet" href="./shinylive/shinylive.css" /> | ||
|
||
</head> | ||
<body> | ||
|
||
<div style="height: 100vh; width: 100vw" id="root"></div> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.