Description Usage Arguments Value See Also Examples
Extract the elements of a path before/after a regex occurrence.
Stands in contrast to front
,back
, and index in that with the
later three are element number/index focused whereas
before
/after
are content focused.
1 2 3 |
x |
A |
pattern |
A character string containing a regular expression (or
character string for |
include |
logical. If |
collapse |
logical. If |
... |
ignored. |
Returns a vector (either atomic
or list
of
character
path elements) of sub-paths.
Other sub-path manipulation functions: front
,
index
, swap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | (parsed <- list(c("a", "really", "boring", "path", "for", "R")))
before(parsed, "^bor")
before(parsed, "^bor", include = TRUE)
after(parsed, "^bor")
after(parsed, "^bor", include = TRUE)
library(magrittr)
files %>%
parse_path() %>%
after("^qdap$")
files %>%
parse_path() %>%
after("^qdap$", include = TRUE)
files %>%
parse_path() %>%
before("\\.R$")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.