R - 无法导入CSV文件 - 列标题

时间:2017-08-09 19:10:25

标签: r csv

我在导入csv文件时遇到问题,因为斜线是这样的:",""日期"",""收入&# 34;"&#34 ;.我尝试了很多东西,但它一直导入为1列,而不是3。你能帮我吗?

1 个答案:

答案 0 :(得分:1)

您可以从readr包中尝试以下代码。

*注意:您需要在导入后提供df列名称。

readr::read_csv(file, col_names = FALSE) # need to remove the first row as well

readr::read_csv(file, skip = 1)