Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在从存储的数据框中创建线性模型时遇到问题,因为自变量包含逗号分隔符(即 314,567.5 与 314567.4)。我如何使用read.csv或readr读取数据集并返回该特定列中没有逗号的数据框?
read.csv
readr
逗号问题的答案在这里。
但是,您首先需要将文件读入R. 虽然这可能有点痛苦,但我发现这read.fwf通常是这些情况下的最佳解决方案,除非您有不同的分隔符,例如管道, |,在这种情况下read.delim可能是最好的。
R
read.fwf
|
read.delim