View source: R/separate_text.R
separate_text | R Documentation |
Separate all matching text into multiple rows
separate_text(txt, pattern, column = "text")
txt |
a tibble, usually results from |
pattern |
either a regular expression or a vector of words to find in text |
column |
column name, default "text" |
a tibble
passed to grepl
and str_extract_all
Chris Stubben
# doc <- pmc_xml("PMC2231364")
doc <- xml2::read_xml(system.file("extdata/PMC2231364.xml",
package = "tidypmc"))
txt <- pmc_text(doc)
separate_text(txt, "[ATCGN]{5,}")
separate_text(txt, "\\([A-Z]{3,6}s?\\)")
# pattern can be a vector of words
separate_text(txt, c("hmu", "ybt", "yfe", "yfu"))
# wrappers for separate_text with extra step to expand matched ranges
separate_refs(txt)
separate_tags(txt, "YPO")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.