# NOT RUN {
rxSetSeed(42)
# seed with generator 42
rxnorm()
# Use R's random number generator
rnorm(1)
rxSetSeed(42)
# reproduces the same number
rxnorm()
# But R's random number is not the same
rnorm(1)
# If we reset this to use the R's seed
# (internally RxODE uses a uniform random number to span seeds)
# This can lead to duplicate sequences and seeds
rxSetSeed(-1)
# Now set seed works for both.
# This is not recommended, but illustrates the different types of
# seeds that can be generated.
set.seed(42)
rxnorm()
rnorm(1)
set.seed(42)
rxnorm()
rnorm(1)
# }
Run the code above in your browser using DataLab