% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rename_r.R
\name{rename_r}
\alias{rename_r}
\title{Industrialized file renaming}
\usage{
rename_r(mask_filepath)
}
\arguments{
\item{mask_filepath}{Character 1L. Entire file path of the excel mask}
}
\value{
No return value, called for side effects. Files are renamed
on disk according to the instructions in the Excel mask.
}
\description{
Industrialized file renaming
}
\examples{
library(magrittr)
data(cars)
data(mtcars)

mydir <- tempfile()
dir.create(mydir)

# Two example files to rename: 
saveRDS(cars, file.path(mydir, "cars.rds"))
saveRDS(mtcars, file.path(mydir, "mtcars.rds"))
list.files(mydir)

# Create the mask: 
mask_rename_r(input_path = mydir)

# Fill the mask (in practice you can do it manually): 
mask <- rio::import(file.path(mydir, "mask_rename_r.xlsx"))
mask[["renamed_file"]] <- c("cars_renamed.rds", "mtcars_renamed.rds")
mask[["to_rename"]] <- rep(1, 2)
writexl::write_xlsx(mask, file.path(mydir, "mask_rename_r.xlsx"))

# Apply the rename function: 
rename_r(mask_filepath = file.path(mydir, "mask_rename_r.xlsx"))

# See the renamed files: 
list.files(mydir)

# Clean tempdir: 
unlink(mydir, recursive = TRUE)
}
