path_select_components | R Documentation |
path_select_components()
allows to select individual components from
an fs_path
object via their index.
path_select_components(path, index, from = c("start", "end"))
path |
A path of class |
index |
An integer vector of path positions. (A negative index will work according to R's usual subsetting rules.) |
from |
A character of either |
path_select_components()
is vectorized.
An fs_path
object, which is a character vector that also has class
fs_path
.
path <- fs::path("some", "simple", "path", "to", "a", "file.txt")
path_select_components(path, 1:3)
path_select_components(path, 1:3, "end")
path_select_components(path, -1, "end")
path_select_components(path, 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.