rand: Random numbers

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Generate random sequences of numbers using normal distribution

Usage

1
2
rand(n, mean = 0, sd = 1, style = c("vector", "data.frame"),
  ncol = NULL)

Arguments

n

number of observations.

mean

distribution mean

sd

standard deviation of the mean

style

the style output ("vector", "data.frame")

ncol

the number of columns if style == "data.frame"

Details

This functions generate random numbers based on the nomral distribution through the function rnorm. It uses the 'mean' and standard deviation of the mean to generate 'n' random numbers. The user can choose to generate multiple vectors by setting style == "data.frame".

Value

The function rand returns a a vector or a data.frame with multiple random numbers. components:

vector: A numeric vector with n observations

data.frame: A data.frame with n rows and ncol columns. Each colulm corresponds to one vector with n observations.

Author(s)

Your Full Name

References

Your refrence goes here.

See Also

rnorm

Examples

1
2
3
4
5
rand(n = 10)
rand(n = 100, mean = 3, sd = 1)
# style == "data.frame"
rand(n = 10, style = "data.frame", ncol = 1)
rand(n = 100, mean = 3, sd = 1, style = "data.frame", ncol = 5)

paternogbc/rpackage documentation built on May 23, 2019, 6:05 a.m.