| 1 | # vectorized |
| 2 | |
| 3 | Code |
| 4 | path_select_components(path, 1:3) |
| 5 | Output |
| 6 | some/simple/path another/path/to |
| 7 | Code |
| 8 | path_select_components(path, 1:3, "end") |
| 9 | Output |
| 10 | to/a/file.txt path/to/file2.txt |
| 11 | Code |
| 12 | path_select_components(path, integer()) |
| 13 | Output |
| 14 | |
| 15 | Code |
| 16 | unclass(path_select_components(path, integer())) |
| 17 | Output |
| 18 | [1] "" "" |
| 19 | Code |
| 20 | path_select_components(fs_path(character()), 1:3) |
| 21 | Output |
| 22 | character(0) |
| 23 | Code |
| 24 | path_select_components(fs_path(character()), 1:3, "end") |
| 25 | Output |
| 26 | character(0) |
| 27 | Code |
| 28 | class(path_select_components(fs_path(character()), 1:3)) |
| 29 | Output |
| 30 | [1] "fs_path" "character" |
| 31 | Code |
| 32 | class(path_select_components(fs_path(character()), 1:3, "end")) |
| 33 | Output |
| 34 | [1] "fs_path" "character" |
| 35 |