Description Usage Arguments Value Examples
View source: R/sort_filepaths.R
Sorts a data.frame or tibble of filepaths. In the filepaths, it is assumed you have an ID that is at least 3 digits long. The function will sort each column in the input, check each row of IDs matches, and add a new column of the ID.
1 | sort_filepaths(filepaths, id_pattern = "[0-9][0-9][0-9]+")
|
filepaths |
A data.frame or tibble of filepaths with an ID contained |
id_pattern |
By default is a 3 digit pattern. Searches for the pattern indicated as a subject ID. |
A sorted tibble of filepaths with an ID column
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
files = tibble::tibble(files1 = c('/Desktop/subject_111.csv',
'/Desktop/subject_123.csv',
'/Desktop/subject_902'),
files2 = c('/Documents/subject_111.csv',
'/Documents/subject_902',
'/Documents/subject_123.csv'))
sort_filepaths(filepaths = files)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.