generated from rpodcast/r_dev_projects
-
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
Showing
198 changed files
with
410,173 additions
and
12 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
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
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
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
.RData | ||
.Ruserdata | ||
.DS_Store | ||
.Renviron | ||
|
||
# container-specific files | ||
.devcontainer/.rstudio_config/* | ||
|
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 @@ | ||
hello_world <- function() { | ||
print("Hello World!") | ||
} |
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,60 @@ | ||
library(shiny) | ||
source("R/utils.R") | ||
|
||
# Define UI for app that draws a histogram ---- | ||
ui <- fluidPage( | ||
|
||
# App title ---- | ||
titlePanel(hello_world()), | ||
|
||
# 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 @@ | ||
[{"name":"app.R","content":"library(shiny)\nsource(\"R/utils.R\")\n\n# Define UI for app that draws a histogram ----\nui <- fluidPage(\n\n # App title ----\n titlePanel(hello_world()),\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)","type":"text"},{"name":"R/utils.R","content":"hello_world <- function() {\n print(\"Hello World!\")\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,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Shiny examples browser</title> | ||
<script | ||
src="../shinylive/load-shinylive-sw.js" | ||
type="module" | ||
></script> | ||
<script src="../shinylive/jquery.min.js"></script> | ||
<script src="../shinylive/jquery.terminal/js/jquery.terminal.min.js"></script> | ||
<link | ||
href="../shinylive/jquery.terminal/css/jquery.terminal.min.css" | ||
rel="stylesheet" | ||
/> | ||
<script type="module"> | ||
import { runApp } from "../shinylive/shinylive.js"; | ||
const response = await fetch("../app.json"); | ||
if (!response.ok) { | ||
throw new Error("HTTP error loading app.json: " + response.status); | ||
} | ||
const appFiles = await response.json(); | ||
|
||
const appRoot = document.getElementById("root"); | ||
runApp(appRoot, "editor-terminal-viewer", {startFiles: appFiles}, "r"); | ||
</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> |
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 { runApp } from "./shinylive/shinylive.js"; | ||
const response = await fetch("./app.json"); | ||
if (!response.ok) { | ||
throw new Error("HTTP error loading app.json: " + response.status); | ||
} | ||
const appFiles = await response.json(); | ||
|
||
const appRoot = document.getElementById("root"); | ||
runApp(appRoot, "viewer", {startFiles: appFiles}, "r"); | ||
</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.