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.
osf_ls_files(x, path = NULL, type = "any", pattern = NULL,
n_max = 10, verbose = FALSE)
One of the following:
An osf_tbl_node
with a single project or component.
An osf_tbl_file
with a single directory.
List files within the specified subdirectory path.
Filter query by type. Set to "file"
to list only files, or
"folder"
to list only folders
Character string used to filter for results that contain the
substring "pattern"
in their name. Note: this is a fixed, case-insensitive
search.
Number of results to return from OSF.
Logical, indicating whether to print informative messages
about interactions with the OSF API (default FALSE
).
An osf_tbl_file
with one row for each file or directory.
osf_ls_nodes()
to generate a list of projects and components.
# NOT RUN {
# Retrieve the Psychology Reproducibility Project from OSF
pysch_rp <- osf_retrieve_node("ezum7")
# List all files and directories
osf_ls_files(pysch_rp)
# ...only the directories
osf_ls_files(pysch_rp, type = "folder")
# ...only PDF files
osf_ls_files(pysch_rp, type = "file", pattern = "pdf")
# List the contents of the first directory
osf_ls_files(pysch_rp, path = "RPP_SI_Figures")
# }
Run the code above in your browser using DataLab