files_to_convert {basepenguins} | R Documentation |
List files to convert in a directory
Description
This function lists all files in a directory (and subdirectories) that match
the specified file extensions. It can be used as a helper to find files paths
to pass to convert_files()
and convert_files_inplace()
,
or to preview which files those functions, as well as convert_dir()
and
convert_dir_inplace()
will look to convert. It can also be used as input to
output_paths()
to help generate output paths for new files.
Usage
files_to_convert(
dir,
full.names = FALSE,
extensions = c("R", "r", "qmd", "rmd", "Rmd")
)
Arguments
dir |
A character string specifying the directory path to search |
full.names |
Logical. If |
extensions |
A character vector of file extensions to filter by.
Default is |
Value
A character vector of file paths that match the specified extensions.
See Also
convert_files()
, convert_files_inplace()
, convert_dir()
, convert_dir_inplace()
,
output_paths()
.
Examples
example_dir <- example_dir() # Get examples directory
files_to_convert(example_dir)
files_to_convert(example_dir, full.names = TRUE)
files_to_convert(example_dir, extensions = "R")
files_to_convert(example_dir, extensions = NULL) # all files