Nothing
#' Set parallel threads
#'
#' @param thread_num number of threads. use '1' for non parallel behavior
#'
#' @return None
#'
#' @examples
#' \donttest{
#' tglkmeans.set_parallel(8)
#' }
#' @export
tglkmeans.set_parallel <- function(thread_num) {
if (thread_num <= 1) {
options(tglkmeans.parallel = FALSE)
RcppParallel::setThreadOptions(numThreads = 1)
} else {
doFuture::registerDoFuture()
future::plan(future::multicore, workers = thread_num)
options(tglkmeans.parallel = TRUE)
options(tglkmeans.parallel.thread_num = thread_num)
RcppParallel::setThreadOptions(numThreads = thread_num)
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.