examp <- structure(list(person = structure(c(1L, 2L, 1L, 3L),
.Label = c("bob", "greg", "sue"), class = "factor"), text =
c("I love chicken [unintelligible]!",
"Me too! (laughter) It's so good.[interrupting]",
"Yep it's awesome {reading}.", "Agreed. {is so much fun}")), .Names =
c("person", "text"), row.names = c(NA, -4L), class = "data.frame")
examp
rm_bracket(examp$text, pattern = "square")
rm_bracket(examp$text, pattern = "curly")
rm_bracket(examp$text, pattern = c("square", "round"))
rm_bracket(examp$text)
ex_bracket(examp$text, pattern = "square")
ex_bracket(examp$text, pattern = "curly")
ex_bracket(examp$text, pattern = c("square", "round"))
ex_bracket(examp$text, pattern = c("square", "round"), merge = FALSE)
ex_bracket(examp$text)
ex_bracket(examp$tex, include.markers=TRUE)
if (FALSE) {
library(qdap)
ex_bracket(examp$tex, pattern="curly") %>%
unlist() %>%
na.omit() %>%
paste2()
}
x <- "I like [bots] (not). And many do not {he he}"
rm_round(x)
ex_round(x)
ex_round(x, include.marker = TRUE)
rm_square(x)
ex_square(x)
rm_curly(x)
ex_curly(x)
rm_angle(x)
ex_angle(x)
lapply(ex_between('She said, "I am!" and he responded..."Am what?".',
left='"', right='"'), "[", c(TRUE, FALSE))
Run the code above in your browser using DataLab