% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/projects.R
\name{projects}
\alias{projects}
\title{Manage REDCapSync projects}
\format{
A named list of functions for managing REDCapSync projects.
}
\usage{
projects
}
\description{
\code{projects} is the central interface for managing REDCap projects in
\strong{REDCapSync}. It provides a convenient, persistent registry of projects
that can be accessed across R sessions.

Each time a project is set up or synced, basic metadata is stored locally so
that projects can be reloaded and updated without reconfiguration.
}
\details{
\code{projects} is implemented as a singleton list object and serves as a single
entry point to the REDCapSync workflow. All project-level operations—such as
setup, loading, syncing, and removal—are accessed through this object.

A key advantage of this design is support for \strong{method chaining}, even
without loading the namespace. Because many project methods return project
objects, you can write concise, readable workflows that operate in sequence:

\preformatted{
# load, sync, and generate dataset to global
REDCapSync::projects$load("TEST_CLASSIC")$
  sync()$
  generate_dataset(envir = globalenv(),
                   filter_field = "var_branching",
                   filter_choices = "Yes")
}
}
\section{Methods}{


\describe{

\item{\code{print()}}{
Display a summary of all registered projects.
\itemize{
\item Shows total number of projects
\item Lists project names
\item Indicates how many are due for sync
}

Returns the project data frame invisibly.
}

\item{\code{any()}}{
Check whether any projects are registered.

Returns a logical scalar.
}

\item{\code{n()}}{
Return the number of registered projects.

Returns an integer.
}

\item{\code{names()}}{
Return the names of registered projects.

Returns a character vector.
}

\item{\code{test_names()}}{
Return the names of test projects.

Returns a character vector.
}

\item{\code{df()}}{
Retrieve the project registry as a data frame.

Returns a data frame containing stored project metadata.
}

\item{\code{load(project_name)}}{
Load a project by name. This is a wrapper for \link{load_project}.

\strong{Arguments}
\itemize{
\item \code{project_name}: Character. Name of the project.
}

Returns a \code{REDCapSyncProject} object.
}

}
}

\examples{
project_df <- projects$df()
projects$print()
projects$any()
projects$n()
projects$names()
project <- projects$load("TEST_CLASSIC")
}
\seealso{
\code{vignette("REDCapSync", package = "REDCapSync")}
\code{vignette("Cache", package = "REDCapSync")}
\code{vignette("RosyREDCap", package = "REDCapSync")}
\link{setup_project} for initializing projects
\link{project} for using the project objects
}
