Newer
Older
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitmodel.R
\title{Fit models in parallel for each group using mclapply and handle logging.
Uses parallel_fit to fit the models.}
\usage{
parallel_fit(
groups,
group_by,
formula,
data,
n.cores = NULL,
log_file = paste(tempdir(check = FALSE), "htrfit.log", sep = "/"),
cl_type = "PSOCK",
}
\arguments{
\item{groups}{Vector of unique group values}
\item{group_by}{Column name in data representing the grouping variable}
\item{formula}{Formula specifying the model formula}
\item{data}{Data frame containing the data}
\item{n.cores}{The number of CPU cores to use for parallel processing.
If set to NULL (default), the number of available CPU (minus 1) cores will be automatically detected.}
\item{log_file}{File to write log (default : Rtmpdir/htrfit.log)}
\item{cl_type}{cluster type (defautl "PSOCK"). "FORK" is recommanded for linux.}
\item{...}{Additional arguments to be passed to the glmmTMB::glmmTMB function}
}
\value{
List of fitted model objects or NULL for any errors
}
\description{
Fit models in parallel for each group using mclapply and handle logging.
Uses parallel_fit to fit the models.
}
\examples{
parallel_fit(group_by = "Species", groups = iris$Species,