% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rbmi.R
\name{par_lapply}
\alias{par_lapply}
\title{Parallelise Lapply}
\usage{
par_lapply(cl, fun, x, ...)
}
\arguments{
\item{cl}{Cluster created by \code{\link[parallel:makeCluster]{parallel::makeCluster()}} or \code{NULL}}

\item{fun}{Function to be run}

\item{x}{object to be looped over}

\item{...}{extra arguments passed to \code{fun}}
}
\value{
\code{list} of results of calling \code{fun} on elements of \code{x}.
}
\description{
Simple wrapper around \code{lapply} and \code{\link[parallel:clusterApply]{parallel::clusterApplyLB}} to abstract away
the logic of deciding which one to use
}
