% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cache.R
\name{cache_clear}
\alias{cache_clear}
\title{Clear your cached projects}
\usage{
cache_clear(project_names = NULL)
}
\arguments{
\item{project_names}{character vector of project project_names previously
setup. If NULL, will get all from \code{get_projects()}}
}
\value{
Message of outcome and invisible NULL.
}
\description{
Finds the location of the cache established by \code{\link[hoardr]{hoard}}
and deletes stored project information (not data)! If you provide
\code{project_names}, it will remove only those projects from the cache. If you
want to truly delete the project files, you must do so at the project
directory you set up.
}
\details{
The cache only stores information like project_name, token_name, directory
location, and other details from \code{\link[=setup_project]{setup_project()}}.The default location of
the cache location is defined by using R_USER_CACHE_DIR if set. Otherwise,
it follows platform conventions via \link[hoardr:hoardr]{hoardr}, saving a file
"R/REDCapSync/projects.rds". No direct project data is stored in the cache.
Notably, tokens and data are not stored here. The key variables stored in
the cache are...
\itemize{
\item \code{project_name} - unique identifier for REDCapSync package
\item \code{redcap_uri} - server location
\item \code{token_name} - where to find token environment with \code{\link[=Sys.getenv]{Sys.getenv()}}
\item \code{dir_path} - where to saved project and associated files locally
\item \code{project_id} - obtained from API call and "locks-in" the connection
\item \code{redcap_version} - obtained from API call and affects links
\item \code{last_sync} and \code{sync_frequency} - informs REDCap sync of when to update
\item other variables from project info and some internal package mechanics
}
}
\examples{
\dontrun{
cache_clear("OLD_PROJECT")
cache_clear() # every project
}

}
\seealso{
\code{vignette("Cache", package = "REDCapSync")}
\link{setup_project} for initializing projects
}
