Reputation: 11
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
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