| ls_files | R Documentation |
This function is equivalent to the Unix ls command but works across platforms.
It can list files and directories matching a regular expression pattern.
ls_files(path = ".", regexp = NULL)
path |
A character vector of one or more paths to search |
regexp |
A regular expression pattern to filter files/directories |
The function:
Handles both single and multiple paths
Supports regular expression filtering
Removes system-specific directories (e.g., @eaDir)
Returns full paths
A character vector of file and directory paths
# List all files in current directory
org::ls_files()
# List only R files
org::ls_files(regexp = "\\.R$")
# List files in multiple directories
org::ls_files(c("dir1", "dir2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.