Description Usage Arguments Details Author(s) Examples
Read out participant IDs of a specified format from filenames
1 2 | read_out_ID(ID_format, folderpath = ".", filenames = FALSE,
remove_ = TRUE, ...)
|
ID_format |
The way the participant ID is structured. See details. |
folderpath |
A (vector of) character string(s) of the folder path(s) you want to extract participant IDs from. If none is provided, the current working directory is searched. You can also just pass a (vector of) file name(s). |
filenames |
Do you want to get the filenames that contain valid IDs
rather than just the IDs? Defaults to |
remove_ |
When the ID is separated from the actual file name with an
underscore (i.e. if |
... |
Additional arguments for |
When you have consistent file names that start with a participant ID
(or a number followed by an underscore and a participant ID),
read_out_ID()
will extract it for you. It will either take
into account all files in a given folder (path passed in
folderpath
) or a (vector of) single file name(s).
You need to specify the format the IDs have via ID_format
.
That is, you give an example where "X" is a letter and "0" is a
digit. And _ is an underscore. For example, when your participant
IDs look like "JD_29MM" or "JT_03KD", you'd type in "XX_00XX". X can
stand for an upper or lower case letter.
Because you can directly run them from your console, the examples in this documentation only work with file names. However, if you'd like to see examples with a folder (path), head to the example folder on GitHub.
Juliane Tkotz juliane.tkotz@hhu.de
1 2 3 4 5 6 | my_files <- c("LF00AP_data.txt", "JT13MP_data.txt", "MT99KD_data.txt",
"dont_catch_me.txt")
read_out_ID("XX00XX_", my_files)
read_out_ID("XX00XX_", my_files, remove_ = FALSE)
read_out_ID("XX00XX_", my_files, filenames = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.