
[英]using read_excel to get multiple sheets with different col_types set
[英]read_excel() throws warning even when col_types is specified
我有一个 Excel 文件,其中一列在 Excel 中格式为货币。 我在read_excel()
函数中指定了 col_types 但 R 仍然在控制台中抛出警告。
所以我做了一些研究,我在这里发现了一个类似的问题,除了它没有 MWE 或任何对我有帮助的答案。
这是一个 MWE excel 文件:
和警告:
> cost <- read_excel("Minimal sample.xlsx", sheet = 1, skip = 0, col_types = c("text", "text", "numeric"))
Warning messages:
1: In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
Expecting numeric in C2 / R2C3: got a date
2: In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
Expecting numeric in C3 / R3C3: got a date
3: In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, :
Expecting numeric in C4 / R4C3: got a date
我已经指定col_types
,为什么我仍然收到任何警告?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.