Learn R Programming

poweRlaw (version 0.60.3)

dist_rand: Random number generation for the distribution objects

Description

This is generic function for generating random numbers from the underlying distribution of the distribution reference objects. This function generates n random numbers using the parameters and xmin values found in the associated reference object.

Usage

dist_rand(m, n)
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")
"dist_rand"(m, n = "numeric")

Arguments

m
a distribution object.
n
number of observations to be generated.

Value

n random numbers

See Also

dist_cdf, dist_pdf and dist_ll

Examples

Run this code
##########################################
#Create distribution object              #
##########################################
m = displ$new()
m$setXmin(7);m$setPars(2)

##########################################
#Generate five random numbers            #
##########################################
dist_rand(m, 5)

Run the code above in your browser using DataLab