Spaces:
Sleeping
Sleeping
Commit
·
37fb20e
0
Parent(s):
Duplicate from FreddyHernandez/poisson
Browse files- .DS_Store +0 -0
- .gitattributes +34 -0
- Dockerfile +17 -0
- README.md +12 -0
- app.R +2 -0
- server.R +9 -0
- ui.R +40 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM rocker/shiny-verse:latest
|
2 |
+
|
3 |
+
WORKDIR /code
|
4 |
+
|
5 |
+
# Install stable packages from CRAN
|
6 |
+
RUN install2.r --error \
|
7 |
+
ggExtra \
|
8 |
+
shiny
|
9 |
+
|
10 |
+
# Install development packages from GitHub
|
11 |
+
RUN installGithub.r \
|
12 |
+
rstudio/bslib \
|
13 |
+
rstudio/httpuv
|
14 |
+
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|
README.md
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Poisson
|
3 |
+
emoji: 📚
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: yellow
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
duplicated_from: FreddyHernandez/poisson
|
9 |
+
license: openrail
|
10 |
+
---
|
11 |
+
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.R
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# Run the application
|
2 |
+
shinyApp(ui = ui, server = server)
|
server.R
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
shinyServer(function(input, output) {
|
2 |
+
|
3 |
+
output$grafico1 <- renderPlot({
|
4 |
+
prob <- dpois(x=0:input$n, lambda=input$l)
|
5 |
+
barplot(prob, ylim=c(0, 1), names.arg=0:input$n,
|
6 |
+
xlab="x", ylab=expression(P(X==x)), col="deepskyblue3", las=1)
|
7 |
+
grid()
|
8 |
+
})
|
9 |
+
})
|
ui.R
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
library(shiny)
|
2 |
+
|
3 |
+
# Define UI for application that draws a histogram
|
4 |
+
shinyUI(fluidPage(
|
5 |
+
|
6 |
+
# Application title
|
7 |
+
titlePanel("Distribución Poisson"),
|
8 |
+
|
9 |
+
# Sidebar with a slider input for the number of bins
|
10 |
+
sidebarLayout(
|
11 |
+
sidebarPanel(
|
12 |
+
p("Modifique los valores de los parámetros y observe
|
13 |
+
lo que sucede en el diagrama"),
|
14 |
+
br(),
|
15 |
+
sliderInput(inputId = "l",
|
16 |
+
label = HTML("Media λ:"),
|
17 |
+
min = 0,
|
18 |
+
max = 40,
|
19 |
+
value = 5,
|
20 |
+
step= .1,
|
21 |
+
animate = TRUE),
|
22 |
+
numericInput(inputId = "n",
|
23 |
+
label = "Ingrese el máximo valor de x para el cual desea ver las probabilidades:",
|
24 |
+
min = 10,
|
25 |
+
max = 500,
|
26 |
+
value = 20,
|
27 |
+
step= 1),
|
28 |
+
br(),
|
29 |
+
p("App creada por el Semillero de R de la Universidad Nacional de Colombia:"),
|
30 |
+
tags$a(href="https://srunal.github.io/",
|
31 |
+
"https://srunal.github.io/")
|
32 |
+
),
|
33 |
+
|
34 |
+
# Show a plot of the generated distribution
|
35 |
+
mainPanel(
|
36 |
+
h3("Diagrama de barras para las probabilidades", align = "center"),
|
37 |
+
plotOutput("grafico1")
|
38 |
+
)
|
39 |
+
)
|
40 |
+
))
|