簡體   English   中英

Shiny App 和 RStudio 的編碼問題

[英]Encoding issue with Shiny App and RStudio

我在發布在 RStudio 中創建的 Shiny 應用程序時遇到問題。 在本地它運行良好,但在發布時,我收到以下錯誤:

Preparing to deploy application...DONE
Uploading bundle for application: 6271509...Detecting system locale ... DONE
Deploying bundle: 5891038 for application: 6271509 ...
Waiting for task: 1150562680
  building: Building image: 6880241
  building: Installing packages
  building: Installing files
  building: Pushing image: 6880241
  deploying: Starting instances
  success: Stopping old instances
Application successfully deployed to https://victuol.shinyapps.io/CorresponsalesSingleApp/
Deployment completed: https://victuol.shinyapps.io/CorresponsalesSingleApp/
Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
 (Using default: en_US)

以下是我的工作代碼:

library(shiny)

library(DT)

setwd("C:/Users/Usuario/Desktop/Proyecto Shiny Corresponsales")

library("openxlsx")

df<-read.xlsx("Base Datos Corresponsales Bancolombia LIMPIO Hoja 3.xlsx", sheet = 3,colNames = TRUE,cols=c(1,2,3,4,5,6))

ui <- basicPage(
  
  tags$a(
    href="https://lotopunto.negocio.site/", 
    tags$img(src = "Logo Loto Punto PNG.png", height = 260, width = 320, title = "Loto Punto Corresponsal Bancario")
      ),
  h2(strong("Paga, Juega y Recarga. ¡Todo aquí!")),
  h1("Mapa de Corresponsales Bancarios Bancolombia"),
  h3("Digita en la celda 'Search', la ciudad donde estás ubicado. 
  Se desplegarán los Corresponsales Bancarios Bancolombia disponibles"),
  
  
  DT::dataTableOutput("mytable")
)

server <- function(input, output) {
  output$mytable = DT::renderDataTable({
    df
  
    })
}

# Run the application
shinyApp(ui, server)

我正在使用一個 Excel 表,其中包含西班牙語字符(例如“'”)。 這可能是問題嗎? 如何解決這個問題? 請提供解決方案的示例。

解決了! 我所要做的就是消除以下行:

setwd("C:/Users/Usuario/Desktop/Proyecto Shiny Corresponsales")

我嘗試了這個解決方案,寫在這篇文章中: https ://groups.google.com/g/shinyapps-users/c/Fuh74H78G4s

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM