看板 R_Language 關於我們 聯絡資訊
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 入門(寫過其他程式,只是對語法不熟悉) [問題敘述]: 想在shiny中顯示一個table, table是在另一個R script中進行處理(從讀取Excel到mapping,無Warnings訊息) 所以在shiny中想要透過source去執行另一個R script 但卻出現Warnings,目前知道應該是另一個R script在讀取excel產生的, 網路上找了些資料但還是不知道該如何處理 [程式範例]: 1.shiny script source("A.R", local = TRUE) 2.A script mapping_old.rul <-"Desktop/檔案/檔案A/【測試檔案】20180718.xls" mapping_old <- read_excel(mapping_old.url, range = "B3:N103", col_types = c("text", "text", "text", "numeric", "text", "text", "text", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric")) p.s. 原始I欄位在讀取是型態為double但顯示出來為"1900-05-24 02:03:57", 我有強制改為numeric p.s. 單獨執行A script時沒有出現任何warnings訊息,但在shiny中用source執行就有 Warning messages: 1: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I4 / R4C9: got a date 2: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I5 / R5C9: got a date 3: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I6 / R6C9: got a date 4: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I7 / R7C9: got a date 5: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I8 / R8C9: got a date 6: In read_fun(path = path, sheet_i = sheet, limits = limits, ... : Expecting numeric in I9 / R9C9: got a date [環境敘述]: R studio mac [關鍵字]: shiny, source, readxl -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.246.173.55 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1531960711.A.7F9.html
Wush978: 比對看看你跑shiny的sessionInfo()與沒warnings時的 07/19 15:07
Wush978: sessionInfo(),注意一下環境變數相關的設定有無一致 07/19 15:07
e181280: 都一樣耶...我是前後接續執行的 07/19 15:42
andrew43: 警告訊息中指出的excel格是否手動檢查過了? 07/19 15:45
HumuHumu: 試試看source("global.R",encoding = "UTF-8")呢 07/19 20:26