Generates a set of Student's T distributed values.

r_tdist(df, ..., n = default_n(df), .seed = NULL)

Arguments

df

vector of degrees of freedom

...

Unused

n

number of observations to generate. The default_n() function will provide a default value within context

.seed

One of the following:

  • NULL (default) will not change the current seed. This is the usual case for generating random numbers.

  • A numeric value. This will be used to set the seed before generating the random numbers. This seed will be stored with the results.

  • TRUE. A random seed value will be generated and set as the seed before the results are generated. Again, this will be stored with the results.

To extract the random seed from a previously generated set of values, use pull_seed()

Value

A numeric vector of length n

Examples

set_n(5) r_tdist(10)
#> [1] 2.2140826 1.6408442 -0.3098129 0.3402945 -0.6886386
r_tdist(1:10)
#> [1] -0.69300596 1.34329219 1.14882681 -0.77407169 0.03398438 0.15930033 #> [7] 0.94094363 -0.44624802 -0.40464933 -0.19402149
r_tdist(10, n = 10)
#> [1] -1.12826210 0.46427911 -0.70476069 1.46582240 -0.28822105 -0.27637620 #> [7] -0.60889543 -0.86523567 -0.05853521 -0.39711420