% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inspect_vars.R
\name{inspect_vars}
\alias{inspect_vars}
\title{Inspect a collection of datasets}
\usage{
inspect_vars(
  input_path,
  output_path,
  output_label,
  considered_extensions,
  encoding = NULL
)
}
\arguments{
\item{input_path}{Character. Folder path containing datasets to explore.}

\item{output_path}{Character. Folder path where the Excel output will be written.}

\item{output_label}{Character. A concise label for the output file name.}

\item{considered_extensions}{Character vector. File extensions to include
(without the dot, e.g. \code{"rds"} not \code{".rds"}).}

\item{encoding}{Character 1L or \code{NULL}. Encoding passed to
\code{rio::import()} for text-based formats (CSV, TSV). Must be one of
\code{"unknown"}, \code{"UTF-8"}, or \code{"Latin-1"}. Defaults to
\code{NULL} (let \code{rio} / \code{data.table} pick the default).
Ignored for binary formats (e.g. RDS, xlsx).}
}
\value{
Invisibly returns the path to the written Excel file.
The file contains sheets: dims, inspect_tot, one per dataset inspection,
vars_detect, vars_detect_everywhere, vars_detect_not_everywhere,
vars_compclasses, vars_compclasses_allsame, vars_compclasses_not_allsame.
}
\description{
Read all datasets from a folder matching the specified extensions, inspect each one,
and write a comprehensive Excel report covering variable presence, types, and per-dataset summaries.
}
\examples{
mydir <- file.path(tempdir(), "inspect_vars_example")
dir.create(mydir)

saveRDS(cars, file.path(mydir, "cars1.rds"))
saveRDS(mtcars, file.path(mydir, "cars2.rds"))

inspect_vars(input_path = mydir, output_path = mydir,
             output_label = "cardata",
             considered_extensions = "rds")

# Read back the 10 sheets:
purrr::map(1:10, function(x)
           rio::import(file.path(mydir, "inspect_vars_cardata.xlsx"),
                       sheet = x))

unlink(mydir, recursive = TRUE)
}
