Learn R Programming

EpiNow2 (version 1.3.4)

set_dt_single_thread: Set to Single Threading

Description

This function sets the threads used by data.table to 1 in the parent function and then restores the initial data.table threads when the function exits. This is primarily used as an internal function inside of other functions and will generally not be used on its own.

Usage

set_dt_single_thread()

Arguments

Value

an environment in the parent frame named "dt_settings"

Examples

Run this code
# \donttest{
data.table::setDTthreads(2)
test_function <- function() {
  set_dt_single_thread()

  print(data.table::getDTthreads())
}
test_function()
data.table::getDTthreads()
# }

Run the code above in your browser using DataLab