我要导入一个数据集,其中数字的格式为小数点逗号,即0,5
而不是0.5
这是虚拟数据。
ID|Item|Transaction Type|Country|Product Code|LCY_1|LCY_2|LCY_ 3|Country Code
1801|Furniture|D|Scotland|0|-15,234|-15,14|-15,34|SC
1802|Book|D|Wales|0|-15,234|-15,14|-15,34|WL
1803|Phone|D|UK|0|-21,234|-15,14|-15,34|UK
1804|Earbuds|D|Ireland|0|-19,234|-15,14|-15,34|IR
1805|Mug|D|Ireland|0|-32,234|-18,14|-15,34|SC
能够按照以下说明导入最合适的视图。但是,未在","
中将read_delim()
设置为小数分隔符。还使用read_csv()
对del = ","
进行了尝试,但是没有用。
df <- read_delim("df.csv", "|", quote = "\\\"",
escape_double = FALSE, trim_ws = TRUE)
如何成功导入?