-
-
Save cigrainger/5fc621687e49e21d211c7644efd5b9a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data <- readLines('~/Downloads/_chat.txt') | |
remove <- vector(mode = 'logical', length = length(data)) | |
for (i in 1:length(data)){ | |
if (!str_detect(data[i], ': Christopher Grainger: |: Ebony Ruggero: ')) { | |
data[i-1] <- str_c(data[i-1], data[i], sep = ' ') | |
remove[i] <- TRUE | |
} else { | |
remove[i] <- FALSE | |
} | |
} | |
data <- data[!remove] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment