rt: Pseudo-random number generation from t-distribution

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

View source: R/rt.R

Description

This is a slightly modified implementation of stats:rt.

Usage

1
rt(n, df, ncp)

Arguments

n, df

Exactly as in stats:rt.

ncp

A numeric vector of non-centrality parameters.

Details

This function corrects the bug in stats:rt that causes trouble when ncp is a vector. See Bug 17306.

Value

A numeric vector of length n which are pseudo-random numbers from the requested t-distribution.

Author(s)

Long Qu modified the code of stats:rt.

See Also

stats:rt

Examples

1
2
3
4
5
6
7
8
set.seed(99927220)
rt(5,1)  # central t
rt(5,1, 1:5*5) # noncetral t where stats:rt throws warnings
## Not run: 
rt(5,1, c(NA, 1:4*5)) # noncetral t where stats:rt returns all NaN's
rt(5,1, c(1:4*5, NA)) # noncetral t where stats:rt throws extra warnings 

## End(Not run)

hisemi documentation built on July 9, 2017, 9:02 a.m.