Skip to content

Commit b395205

Browse files
2 parents 305b16d + 30916b7 commit b395205

File tree

6 files changed

+221
-0
lines changed

6 files changed

+221
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
## Changes in version 0.15.0
88

99
- Tutorial 10a_anova finalized
10+
- Addition of a test shiny app (histogram.R)
11+
1012

1113
## Changes in version 0.14.0
1214

inst/shiny/histogram/app.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Histogram with variable classes
2+
3+
ui <- fluidPage(
4+
titlePanel(""), #"Choix des classes pour un histogramme"),
5+
sidebarLayout(
6+
sidebarPanel(
7+
sliderInput(inputId = "bins", label = "Nombre de classes:",
8+
min = 1, max = 50, value = 30)
9+
),
10+
mainPanel(
11+
plotOutput(outputId = "distPlot")
12+
)
13+
)
14+
)
15+
16+
server <- function(input, output) {
17+
output$distPlot <- renderPlot({
18+
chart::chart(data = geyser, ~waiting) +
19+
ggplot2::geom_histogram(bins = input$bins,
20+
col = "white", fill = "#75AADB") +
21+
ggplot2::ylab("Fréquence")
22+
})
23+
}
24+
25+
geyser <- data.io::read("geyser", package = "MASS", lang = "fr")
26+
shinyApp(ui, server)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: histogram
2+
title: histogram
3+
username:
4+
account: phgrosjean
5+
server: shinyapps.io
6+
hostUrl: https://api.shinyapps.io/v1
7+
appId: 590204
8+
bundleId: 1721590
9+
url: https://phgrosjean.shinyapps.io/histogram/
10+
when: 1543261164.38148
11+
asMultiple: FALSE
12+
asStatic: FALSE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: ""
3+
output: learnr::tutorial
4+
runtime: shiny_prerendered
5+
---
6+
7+
```{r setup, include=FALSE}
8+
library(learnr)
9+
knitr::opts_chunk$set(echo = FALSE)
10+
```
11+
12+
Write a function that adds any two numbers and then call it:
13+
14+
```{r add-function, exercise=TRUE, exercise.lines = 5}
15+
add <- function() {
16+
17+
}
18+
```
19+
20+
```{r quiz}
21+
quiz(
22+
question("Which package contains functions for installing other R packages?",
23+
answer("base"),
24+
answer("tools"),
25+
answer("utils", correct = TRUE),
26+
answer("codetools")
27+
)
28+
)
29+
```

inst/shiny/learnr/Test learnr/Test_learnr.html

Lines changed: 140 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: learnr
2+
title: learnr
3+
username:
4+
account: phgrosjean
5+
server: shinyapps.io
6+
hostUrl: https://api.shinyapps.io/v1
7+
appId: 590599
8+
bundleId: 1721660
9+
url: https://phgrosjean.shinyapps.io/learnr/
10+
when: 1543264138.79986
11+
asMultiple: FALSE
12+
asStatic: FALSE

0 commit comments

Comments
 (0)