View source: R/param_tracking.R
| set_seed | R Documentation |
Set a random seed and track it for reproducibility. Note: This function is explicitly designed to set random seeds as requested by the user.
set_seed(
seed = NULL,
kind = NULL,
normal.kind = NULL,
sample.kind = NULL,
analysis_name = NULL,
registry_file,
set_seed = TRUE
)
seed |
Numeric. Random seed to set. If NULL, generates random seed. |
kind |
Character. RNG kind (see ?set.seed). Default NULL uses current. |
normal.kind |
Character. Normal RNG kind. Default NULL uses current. |
sample.kind |
Character. Sample RNG kind. Default NULL uses current. |
analysis_name |
Character. Name to associate with this seed |
registry_file |
Character. Path to seed registry (required). |
set_seed |
Logical. If TRUE, actually sets the seed. If FALSE, only tracks it. Default TRUE. |
The seed value (invisibly)
## Not run:
# Set and track a specific seed
set_seed(12345, analysis_name = "simulation_1",
registry_file = tempfile(fileext = ".json"))
# Generate and track a random seed
set_seed(analysis_name = "bootstrap_analysis",
registry_file = tempfile(fileext = ".json"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.