# NOT RUN {
skips <- c(0, 1, 1, 0, 0, 1)
path <- system.file("docs/transcripts", package = 'textreadr')
textreadr::peek(read_dir_transcript(path, skip = skips), Inf)
# }
# NOT RUN {
## with additional cleaning
library(tidyverse, textshape, textclean)
path %>%
read_dir_transcript(skip = skips) %>%
textclean::filter_row("Person", "^\\[") %>%
mutate(
Person = stringi::stri_replace_all_regex(Person, "(^/\\s*)|(:\\s*$)", "") %>%
trimws(),
Dialogue = stringi::stri_replace_all_regex(Dialogue, "(^/\\s*)", "")
) %>%
peek(Inf)
# }
Run the code above in your browser using DataLab