[問題] shiny執行source可執行但出現Warnings
[問題類型]:
程式諮詢(我想用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
→
07/19 15:07,
6年前
, 1F
07/19 15:07, 1F
→
07/19 15:07,
6年前
, 2F
07/19 15:07, 2F
→
07/19 15:42,
6年前
, 3F
07/19 15:42, 3F
→
07/19 15:45,
6年前
, 4F
07/19 15:45, 4F
→
07/19 20:26,
6年前
, 5F
07/19 20:26, 5F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章