Skip to main content

Package options

Source: R/session.R

Description

Settings that change how CausalStructures behaves: one option, set with options(), and the number of threads, set with an environment variable.

Options

CausalStructures.open
Logical, default TRUE. Default for the open argument of ancestors(), descendants(), possible_ancestors(), possible_descendants(), anteriors(), and posteriors(): TRUE (open definition) excludes the query node itself from the result, FALSE (closed definition) includes it.

Number of threads

count_dags(), enumerate_dags(), enumerate_mags(), pagcauses(), all_backdoor_sets(), all_adjustment_sets(), and all_frontdoor_sets() can search in parallel. By default they use one thread. To use more, set JULIA_NUM_THREADS to a number, or to "auto" for one thread per core, before loading the package:

Sys.setenv(JULIA_NUM_THREADS = "auto")
library(CausalStructures)

To make this permanent, set it in your .Renviron file instead. The number cannot be changed once the package is loaded, so restart R to change it.