% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/convert_r.R
\name{convert_r}
\alias{convert_r}
\title{Batch dataset format conversion using an Excel mask}
\usage{
convert_r(mask_filepath, output_path)
}
\arguments{
\item{mask_filepath}{Character. Full file path to the Excel mask.
The mask must contain columns: \code{folder_path}, \code{file},
\code{converted_file}, \code{to_convert} (1 to convert, 0 to skip).}

\item{output_path}{Character. Folder path where converted files will be placed.}
}
\value{
Invisibly returns a character vector of output file paths.
}
\description{
Read an Excel mask describing files to convert, then import, clean, and
re-export each file in the desired format. Cleaning includes replacing void
character values (\code{""}) with \code{NA} and trimming whitespace.
}
\examples{
mydir <- system.file("permadir_examples_and_tests/convert_r", package = "scrutr")

mask <- data.frame(
  folder_path = rep(mydir, 2),
  file = c("original_cars.rds", "original_mtcars.csv"),
  converted_file = c("converted_cars.csv", "converted_mtcars.csv"),
  to_convert = rep(1, 2)
)

\donttest{
mask_path <- file.path(tempdir(), "mask_convert_r.xlsx")
writexl::write_xlsx(mask, mask_path)

convert_r(
  mask_filepath = mask_path,
  output_path = tempdir()
)

# Clean up:
file.remove(file.path(tempdir(),
  c("converted_cars.csv", "converted_mtcars.csv", "mask_convert_r.xlsx")))
}
}
