R/set_sar_threads.R

Defines functions set_sar_threads

Documented in set_sar_threads

#' @param n_threads For `set_sar_threads`, the number of threads to use. Defaults to half the number of logical cores.
#'
#' @rdname user_predict
#' @export
set_sar_threads <- function(n_threads)
{
    if(missing(n_threads))
        n_threads <- max(1, parallel::detectCores()/2)
    RcppParallel::setThreadOptions(numThreads=as.integer(n_threads))
}

Try the SAR package in your browser

Any scripts or data that you put into this service are public.

SAR documentation built on Oct. 23, 2020, 7:55 p.m.