% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/initStudy.R
\name{initStudy}
\alias{initStudy}
\title{Creates initial directory for an OMOP CDM network study}
\usage{
initStudy(
  directory,
  diagnostics = TRUE,
  study = TRUE,
  studyTitle = NULL,
  studyLeads = NULL,
  studyDescription = NULL,
  repository = NULL,
  organisation = NULL,
  private = TRUE
)
}
\arguments{
\item{directory}{Path to a directory that will be used as the root folder
for the study. If it does not exist, it will be created. The directory
must be empty if it already exists.}

\item{diagnostics}{A single TRUE or FALSE value.
If TRUE (the default), the function creates the `diagnosticsCode/`
and `diagnosticsShiny/` folders using the package templates.
If FALSE, these diagnostics folders are not created.}

\item{study}{A single TRUE or FALSE value.
If TRUE (the default), the function creates the `studyCode/`
and `studyShiny/` folders using the package templates.
If FALSE, these study folders are not created.}

\item{studyTitle}{Character string with the study title. If NULL (default),
uses the directory basename.}

\item{studyLeads}{Character string with study leads. If NULL (default),
leaves a placeholder.}

\item{studyDescription}{Character string with study description. If NULL (default),
leaves a placeholder.}

\item{repository}{Optional GitHub repository name. If provided, creates a GitHub
repository and links it to the study. Requires the \code{gh} and \code{gert}
packages and GitHub authentication (for example via \code{GITHUB_PAT}).}

\item{organisation}{Optional GitHub organisation name. If NULL (default), creates
repository under your personal account. Only used when \code{repository} is provided.}

\item{private}{Logical. If TRUE (default), creates a private GitHub repository.
Only used when \code{repository} is provided.}
}
\value{
Project directory will be created
}
\description{
Creates initial directory for an OMOP CDM network study
}
\examples{
# Create a study called "SampleStudy" in a temporary directory
study_root <- file.path(tempdir(), "SampleStudy")
initStudy(study_root)

# Inspect the top-level contents
list.files(study_root)

# Create another study with custom metadata
study_root2 <- file.path(tempdir(), "DiabetesStudy")
initStudy(study_root2,
          studyTitle = "Diabetes Prevalence Study",
          studyLeads = "Dr. Smith, Dr. Jones")

\dontrun{
# Create study with GitHub integration (requires GITHUB_PAT)
# Set PAT for current session:
Sys.setenv(GITHUB_PAT = "your_token_here")

study_root3 <- file.path(tempdir(), "GitHubStudy")
initStudy(
  directory = study_root3,
  repository = "my-omop-study",
  organisation = "oxford-pharmacoepi",
  private = TRUE
)
}
}
