作者e181280 (Enya)
看板R_Language
标题[问题] shiny执行source可执行但出现Warnings
时间Thu Jul 19 08:38:29 2018
[问题类型]:
程式谘询(我想用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://webptt.com/cn.aspx?n=bbs/R_Language/M.1531960711.A.7F9.html
1F:→ Wush978: 比对看看你跑shiny的sessionInfo()与没warnings时的 07/19 15:07
2F:→ Wush978: sessionInfo(),注意一下环境变数相关的设定有无一致 07/19 15:07
3F:→ e181280: 都一样耶...我是前後接续执行的 07/19 15:42
4F:→ andrew43: 警告讯息中指出的excel格是否手动检查过了? 07/19 15:45
5F:→ HumuHumu: 试试看source("global.R",encoding = "UTF-8")呢 07/19 20:26