osf_ls_files {osfr} | R Documentation |
List files and directories on OSF
Description
List the files and directories in the top-level of an OSF project, component,
or directory. Specify a path
to list the contents of a particular
subdirectory.
Usage
osf_ls_files(
x,
path = NULL,
type = "any",
pattern = NULL,
n_max = 10,
verbose = FALSE
)
Arguments
x |
One of the following:
|
path |
List files within the specified subdirectory path. |
type |
Filter query by type. Set to |
pattern |
Character string used to filter for results that contain the
substring |
n_max |
Maximum number of results to return from OSF (default is 10).
Set to |
verbose |
Logical, indicating whether to print informative messages
about interactions with the OSF API (default |
Value
An osf_tbl_file
with one row for each file or directory, ordered
by modification time.
See Also
osf_ls_nodes()
to generate a list of projects and components.
Examples
## Not run:
# Retrieve the Psychology Reproducibility Project from OSF
psych_rp <- osf_retrieve_node("ezum7")
# List all files and directories
osf_ls_files(psych_rp)
# ...only the directories
osf_ls_files(psych_rp, type = "folder")
# ...only PDF files
osf_ls_files(psych_rp, type = "file", pattern = "pdf")
# List the contents of the first directory
osf_ls_files(psych_rp, path = "RPP_SI_Figures")
## End(Not run)