Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Formations
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
migale
Formations
Commits
18f490ca
There was an error fetching the commit references. Please try again later.
Commit
18f490ca
authored
1 year ago
by
Mahendra Mariadassou
Browse files
Options
Downloads
Patches
Plain Diff
Ajout d'un exemple simple de reactivité
parent
61d5db3e
No related branches found
No related tags found
No related merge requests found
Pipeline
#87753
passed with stage
Stage: deploy
in 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Shiny/correction/reactlog.R
+54
-0
54 additions, 0 deletions
Shiny/correction/reactlog.R
with
54 additions
and
0 deletions
Shiny/correction/reactlog.R
0 → 100644
+
54
−
0
View file @
18f490ca
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library
(
shiny
)
# Define UI for application that compute A^2 + B^2
ui
<-
fluidPage
(
# Application title
titlePanel
(
"Illustration for reactlog"
),
# Sidebar with two numeric inputs
sidebarLayout
(
sidebarPanel
(
numericInput
(
inputId
=
"A"
,
label
=
"Choose first integer (A)"
,
value
=
3
,
min
=
0
,
max
=
10
,
step
=
1
),
numericInput
(
inputId
=
"B"
,
label
=
"Choose second integer (B)"
,
value
=
4
,
min
=
0
,
max
=
10
,
step
=
1
)
),
# Text and verbatim outputs
mainPanel
(
textOutput
(
"C_text"
),
verbatimTextOutput
(
"C_verbatim"
)
)
)
)
# Define server logic required to draw a histogram
server
<-
function
(
input
,
output
)
{
A2
<-
reactive
({
input
$
A
^
2
},
label
=
"A^2"
)
B2
<-
reactive
({
input
$
B
^
2
},
label
=
"B^2"
)
C2
<-
reactive
({
A2
()
+
B2
()
},
label
=
"C^2"
)
C
<-
reactive
({
paste0
(
"A^2 + B^2 is equal to "
,
C2
(),
"."
)
},
label
=
"C"
)
output
$
C_text
<-
renderText
({
C
()
})
output
$
C_verbatim
<-
renderPrint
({
C
()
})
}
# Run the application
shinyApp
(
ui
=
ui
,
server
=
server
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment