Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitmodel.R
\name{fitModelParallel}
\alias{fitModelParallel}
\title{Fit models in parallel for each group using mclapply and handle logging.
Uses parallel_fit to fit the models.}
\usage{
fitModelParallel(
formula,
data,
group_by,
n.cores = NULL,
log_file = "log.txt",
...
)
}
\arguments{
\item{formula}{Formula specifying the model formula}
\item{data}{Data frame containing the data}
\item{group_by}{Column name in data representing the grouping variable}
\item{n.cores}{The number of CPU cores to use for parallel processing.
If set to NULL (default), the number of available CPU cores will be automatically detected.}
\item{log_file}{File path to save the log messages (default : log.txt)}
\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{
fitModelParallel(formula = Sepal.Length ~ Sepal.Width + Petal.Length,
data = iris, group_by = "Species", n.cores = 1)
}