Skip to contents

spot_unused_files

Usage

spot_unused_files(
  path = ".",
  file.extensions = c("png", "jpg", "jpeg", "gif", "bmp", "tiff", "tif", "csv", "xls",
    "xlsx", "txt"),
  script.extensions = c("R", "Rmd", "qmd"),
  archive = FALSE,
  ignore.folder = "./docs"
)

Arguments

path

A character string with the path to the directory to be analyzed. Default is current directory.

file.extensions

A character vector with the file extensions to be considered. Default is c("png", "jpg", "jpeg", "gif", "bmp", "tiff", "tif", "csv", "xls", "xlsx", "txt").

script.extensions

A character vector with the script extensions to be considered. Default is c("R", "Rmd", "qmd").

archive

A logical value indicating whether to archive the unused files. If TRUE the spotted files will be move into the folder "./unused_files". Default is FALSE.

ignore.folder

A character string with the path or paths to the directory(ies) to be ignored. Default is "./docs".

Value

Returns a data frame with 2 columns: file.name (self explanatory) and folder (where the file is found).

Details

This function is used to spot/remove unused files in a project directory. It is useful to keep the project directory clean and organized. It is recommended to first run the function with a the argument archive = FALSE to spot which files are being spotted and then run archive = TRUE if they need to be removed.

References

Araya-Salas, M., Arriaga, A. (2023), sketchy: research compendiums for data analysis in R. R package version 1.0.3.

Author

Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)

Examples

{
}
#> NULL