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.
data <- read.delim("C:\\test.txt", header = FALSE, sep = "$$$$$") Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1, quiet = TRUE, : invalid 'sep' value: must be one byte
为什么会有这样的限制?我能克服吗?
这是一个潜在的解决方案。
假设这是您文件中的行的样子
1$$$$$2$$$$$3$$$$$4
下面将创建一个矩阵,其中变量存储为字符。
do.call(rbind,strsplit(readLines('test.txt'),'$$$$$',fixed=T))