Upload 3 files
Browse filesFiles changed (4)
- .gitattributes+1
- Dockerfile+34-11
- STATUS1.xlsxAdded+3
- app.R+53-46
31 unmodified lines32333431 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text31 unmodified lines3233343531 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textSTATUS1.xlsx filter=lfs diff=lfs merge=lfs -text
1234567891011121314FROM rocker/r-base:latestWORKDIR /codeRUN install2.r --error \shiny \dplyr \ggplot2 \readr \ggExtraCOPY . .CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]12345678910111213141516171819202122232425262728293031323334353637FROM rocker/shiny:latest# Instalar pacotes R necessáriosRUN R -e "install.packages(c('shiny','readxl','dlookr','rpivotTable'), repos='https://cloud.r-project.org')"# Criar diretório da appRUN mkdir -p /srv/shiny-server/app# Copiar arquivos da appCOPY app.R /srv/shiny-server/app/app.RCOPY STATUS1.xlsx /srv/shiny-server/app/STATUS1.xlsx# Criar diretório www para relatóriosRUN mkdir -p /srv/shiny-server/app/www# Configurar shiny-server para rodar na porta 7860 (Hugging Face Spaces)RUN echo "run_as shiny;\n\server {\n\listen 7860;\n\location / {\n\site_dir /srv/shiny-server/app;\n\log_dir /var/log/shiny-server;\n\directory_index off;\n\}\n\}" > /etc/shiny-server/shiny-server.conf# Definir diretório de trabalhoWORKDIR /srv/shiny-server/app# PermissõesRUN chown -R shiny:shiny /srv/shiny-server /var/log/shiny-server# Expor porta 7860 (padrão Hugging Face Spaces)EXPOSE 7860# Comando para iniciar o servidorCMD ["/usr/bin/shiny-server"]
123version https://git-lfs.github.com/spec/v1oid sha256:27869b5509c04e945c22d2b0d7583dfefcc7944e9a1e5c5488bb3d9a10ac3fc7size 19627712345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758library(shiny)library(bslib)library(dplyr)library(ggplot2)df <- readr::read_csv("penguins.csv")# Find subset of columns that are suitable for scatter plotdf_num <- df |> select(where(is.numeric), -Year)ui <- page_sidebar(theme = bs_theme(bootswatch = "minty"),title = "Penguins explorer",sidebar = sidebar(varSelectInput("xvar", "X variable", df_num, selected = "Bill Length (mm)"),varSelectInput("yvar", "Y variable", df_num, selected = "Bill Depth (mm)"),checkboxGroupInput("species", "Filter by species",choices = unique(df$Species), selected = unique(df$Species)),hr(), # Add a horizontal rulecheckboxInput("by_species", "Show species", TRUE),checkboxInput("show_margins", "Show marginal plots", TRUE),checkboxInput("smooth", "Add smoother"),),plotOutput("scatter"))server <- function(input, output, session) {subsetted <- reactive({req(input$species)df |> filter(Species %in% input$species)})output$scatter <- renderPlot({p <- ggplot(subsetted(), aes(!!input$xvar, !!input$yvar)) +theme_light() +list(theme(legend.position = "bottom"),if (input$by_species) aes(color = Species),geom_point(),if (input$smooth) geom_smooth())if (input$show_margins) {margin_type <- if (input$by_species) "density" else "histogram"p <- p |> ggExtra::ggMarginal(type = margin_type, margins = "both",size = 8, groupColour = input$by_species, groupFill = input$by_species)}p},res = 100)}shinyApp(ui, server)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465library(shiny)library(readxl)library(dlookr)library(rpivotTable)ui <- fluidPage(titlePanel("EDA no Browser – rpivotTable + dlookr"),sidebarLayout(sidebarPanel(h4("Dataset"),p("Arquivo: STATUS1.xlsx"),actionButton("diag", "Gerar diagnóstico dlookr")),mainPanel(tabsetPanel(tabPanel("Pivot Table",rpivotTableOutput("pivot")),tabPanel("Diagnóstico",uiOutput("diag_ui"))))))server <- function(input, output, session) {STATUS <- reactive({read_excel("STATUS1.xlsx")})output$pivot <- renderRpivotTable({rpivotTable(STATUS())})observeEvent(input$diag, {# Criar diretório www se não existirif (!dir.exists("www")) {dir.create("www")}diagnose_web_report(STATUS(),output_dir = "www",output_file = "diagnostico.html")output$diag_ui <- renderUI({tags$iframe(src = "diagnostico.html",width = "100%",height = "800px")})})}shinyApp(ui, server)
.gitattributes+1
Dockerfile+34-11
STATUS1.xlsxAdded+3
app.R+53-46