R原始文本文件读取后缺少行

cha*_*423 0 text r

我目前正在研究一些文本挖掘并尝试使用原始文本读取平面文件,但是当我读入文件时,我在读取后丢失了超过一半的行.该文件看起来与此类似;

ddjkfj; this is a raw line of text ? fjpflij 
jfioej33 this is another line of text jdkfjd
etc.
Run Code Online (Sandbox Code Playgroud)

我试图用这种方法读入,

data <- read.table('text.txt',sep='\n',fill=T)
Run Code Online (Sandbox Code Playgroud)

如果没有跳过或加入线条,我该怎么读?

Gop*_*ala 5

您可以尝试使用readLines:

lines <- readLines('fileToRead.txt')
lines
[1] "ddjkfj; this is a raw line of text ? fjpflij "
[2] "jfioej33 this is another line of text jdkfjd" 
Run Code Online (Sandbox Code Playgroud)