read csv in r, in which one of the column has english sentences and can have "

StackOverflow https://stackoverflow.com/questions/23631281

  •  21-07-2023
  •  | 
  •  

문제

I have a csv with sep='\t'. When I try to read the csv using the following code, not all the rows are read.

data <- read.csv("raw.txt", sep='\t', header=T)

Most likely the reason being, the data has " (quote) in its text. How to read such a file?

Format of file is:

text           freq
he is "Sam"    45
...
도움이 되었습니까?

해결책

Try this:

data <- read.csv("raw.txt", sep='\t', header=T,quote="")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top