Create an excel mask compatible with the rename_r() function.
Source:R/mask_rename_r.R
mask_rename_r.RdCreate an excel mask compatible with the rename_r() function. This must be used on a collection of files, i.e stored within the same folder.
Examples
library(magrittr)
data(cars)
data(mtcars)
mydir <- tempfile()
dir.create(mydir)
saveRDS(cars, file.path(mydir, "cars.rds"))
saveRDS(mtcars, file.path(mydir, "mtcars.rds"))
list.files(mydir)
#> [1] "cars.rds" "mtcars.rds"
mask_rename_r(input_path = mydir)
list.files(mydir)
#> [1] "cars.rds" "mask_rename_r.xlsx" "mtcars.rds"
readxl::read_xlsx(file.path(mydir, "mask_rename_r.xlsx"))
#> # A tibble: 2 × 3
#> file renamed_file to_rename
#> <chr> <lgl> <lgl>
#> 1 cars.rds NA NA
#> 2 mtcars.rds NA NA
unlink(mydir, recursive = TRUE)