Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diamonds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jeremie Sibille
diamonds
Commits
c5025c21
Commit
c5025c21
authored
3 months ago
by
Jeremie Sibille
Browse files
Options
Downloads
Patches
Plain Diff
aes non dynamique
parent
a998da9a
No related branches found
No related tags found
No related merge requests found
Pipeline
#60550
passed
3 months ago
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
shinebright/app.R
+51
-17
51 additions, 17 deletions
shinebright/app.R
with
51 additions
and
17 deletions
shinebright/app.R
+
51
−
17
View file @
c5025c21
...
@@ -8,6 +8,12 @@
...
@@ -8,6 +8,12 @@
#
#
library
(
shiny
)
library
(
shiny
)
library
(
dplyr
)
library
(
ggplot2
)
library
(
DT
)
View
(
diamonds
)
# diamonds <- read.csv("data/diamonds.csv")
# Define UI for application that draws a histogram
# Define UI for application that draws a histogram
ui
<-
fluidPage
(
ui
<-
fluidPage
(
...
@@ -18,32 +24,60 @@ ui <- fluidPage(
...
@@ -18,32 +24,60 @@ ui <- fluidPage(
# Sidebar with a slider input for number of bins
# Sidebar with a slider input for number of bins
sidebarLayout
(
sidebarLayout
(
sidebarPanel
(
sidebarPanel
(
sliderInput
(
"bins"
,
sliderInput
(
"Price"
,
"Number of bins:"
,
"Prix des diamants:"
,
min
=
1
,
min
=
300
,
max
=
50
,
max
=
20000
,
value
=
30
)
value
=
3000
),
selectInput
(
inputId
=
"colorFilter"
,
choices
=
c
(
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"I"
,
"J"
),
label
=
"Choix des couleurs à filtrer"
,
selected
=
NULL
,
multiple
=
FALSE
,
selectize
=
TRUE
,
width
=
NULL
,
size
=
NULL
),
),
radioButtons
(
inputId
=
"rosePoint"
,
label
=
"Colorier les points en Rose ?"
,
selected
=
NULL
,
choices
=
c
(
"oui"
=
"pink"
,
"non"
=
"black"
),
),
),
# Show a plot of the generated distribution
# Show a plot of the generated distribution
mainPanel
(
mainPanel
(
plotOutput
(
"di
st
Plot"
)
plotOutput
(
"di
amond
Plot"
)
,
)
textOutput
(
"txt"
)
)
)
),
DTOutput
(
outputId
=
"DiamondTable"
)
)
)
# Define server logic required to draw a histogram
# Define server logic required to draw a histogram
server
<-
function
(
input
,
output
)
{
server
<-
function
(
input
,
output
)
{
output
$
distPlot
<-
renderPlot
({
output
$
diamondPlot
<-
renderPlot
({
# generate bins based on input$bins from ui.R
diamonds
%>%
x
<-
faithful
[,
2
]
filter
(
price
>
input
$
Price
)
%>%
bins
<-
seq
(
min
(
x
),
max
(
x
),
length.out
=
input
$
bins
+
1
)
filter
(
color
>
input
$
colorFilter
)
%>%
ggplot
(
aes
(
x
=
carat
,
y
=
price
))
+
(
aes
(
color
=
input
$
rosePoint
))
+
geom_point
()
# draw the histogram with the specified number of bins
})
hist
(
x
,
breaks
=
bins
,
col
=
'darkgray'
,
border
=
'white'
,
output
$
DaimondTable
<-
renderDT
({
xlab
=
'Waiting time to next eruption (in mins)'
,
diamonds
%>%
main
=
'Histogram of waiting times'
)
filter
(
price
>
input
$
Price
)
%>%
filter
(
color
>
input
$
colorFilter
)
})
output
$
txt
<-
renderText
({
paste
(
"You chose"
,
input
$
rosePoint
)
})
})
}
}
...
...
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