Learn R Programming

smmR (version 1.0.5)

setSeed: Set the RNG Seed from within Rcpp

Description

Set the RNG Seed from within Rcpp

Usage

setSeed(seed)

Value

A set RNG scope.

Arguments

seed

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

Examples

Run this code
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