Learn R Programming

smmR (version 1.0.3)

setSeed: Set the RNG Seed from within Rcpp

Description

Set the RNG Seed from within Rcpp

Usage

setSeed(seed)

Arguments

seed

An unsigned int that is the seed one wishes to use.

Value

A set RNG scope.

Examples

Run this code
# NOT RUN {
set.seed(10)
x <- rnorm(5, 0, 1)
setSeed(10)
y <- rnorm(5, 0, 1)
all.equal(x, y, check.attributes = FALSE)

# }

Run the code above in your browser using DataLab