user376532
user376532

Reputation: 11

R Text Analysis Question

Let's say I have a text file I read into R: it contains 5 separate transcripts of lectures. Each transcript is separated from another by a common symbol on a line" "~~", how would I create a list with 5 elements, each element being a character vector containing one of those separate transcripts?

Upvotes: 1

Views: 73

Answers (1)

James
James

Reputation: 123

Try using scan.

E.g. x <- scan("data.txt", what="character", sep="~")

Note that the sep argument must be one byte.

Upvotes: 2

Related Questions