roundb commited on
Commit
560a6fc
·
verified ·
1 Parent(s): de03ce7

Upload app_simples.R

Browse files
Files changed (1) hide show
  1. app_simples.R +54 -0
app_simples.R ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Versão simplificada para diagnóstico
2
+ # Testa cada pacote individualmente
3
+
4
+ cat("=== Iniciando aplicação ===\n")
5
+
6
+ cat("Carregando shiny...\n")
7
+ library(shiny)
8
+ cat("shiny carregado com sucesso\n")
9
+
10
+ cat("Carregando readxl...\n")
11
+ library(readxl)
12
+ cat("readxl carregado com sucesso\n")
13
+
14
+ cat("Carregando rpivotTable...\n")
15
+ library(rpivotTable)
16
+ cat("rpivotTable carregado com sucesso\n")
17
+
18
+ cat("Tentando ler o arquivo Excel...\n")
19
+ dados <- tryCatch({
20
+ read_excel("STATUS1.xlsx")
21
+ }, error = function(e) {
22
+ cat("ERRO ao ler Excel:", e$message, "\n")
23
+ return(NULL)
24
+ })
25
+
26
+ if (!is.null(dados)) {
27
+ cat("Arquivo Excel lido com sucesso! Linhas:", nrow(dados), "\n")
28
+ } else {
29
+ cat("Falha ao ler arquivo Excel\n")
30
+ }
31
+
32
+ ui <- fluidPage(
33
+ titlePanel("Teste Simplificado - Pivot Table"),
34
+
35
+ mainPanel(
36
+ h3("Se você vê isto, a aplicação iniciou!"),
37
+ rpivotTableOutput("pivot")
38
+ )
39
+ )
40
+
41
+ server <- function(input, output, session) {
42
+ cat("Servidor iniciado\n")
43
+
44
+ output$pivot <- renderRpivotTable({
45
+ if (!is.null(dados)) {
46
+ rpivotTable(dados)
47
+ } else {
48
+ NULL
49
+ }
50
+ })
51
+ }
52
+
53
+ cat("Iniciando shinyApp...\n")
54
+ shinyApp(ui, server)