R/test_helper_functions.R
random_FLQuant_generator.Rd
Generate a randomly or fixed sized FLQuant filled with normally distributed random numbers with a mean of 0. Used for automatic testing.
A vector of length 6 with the fixed length of each of the FLQuant dimensions. If any value is NA it is randomly set using the max_dims argument. Default value is rep(NA,6).
A vector of length 6 with minimum size of each of the FLQuant dimensions. Default value is c(1,1,1,1,1,1).
A vector of length 6 with maximum size of each of the FLQuant dimensions. Default value is c(5,10,5,4,4,5).
The name of the first age group.
The standard deviation of the random numbers. Passed to rnorm() Default is 100.
An FLQuant
flq <- random_FLQuant_generator()
dim(flq)
#> [1] 4 9 2 4 4 1
summary(flq)
#> An object of class "FLQuant" with:
#> dim : 4 9 2 4 4 1
#> quant: age
#> units: 1.44
#>
#> Min : -331.0632
#> 1st Qu.: -70.11992
#> Mean : 1.572883
#> Median : 0.6193255
#> 3rd Qu.: 76.13671
#> Max : 373.4765
#> NAs : 0 %
flq <- random_FLQuant_generator(fixed_dims = c(NA,10,1,4,1,NA))
dim(flq)
#> [1] 4 10 1 4 1 4
summary(flq)
#> An object of class "FLQuant" with:
#> dim : 4 10 1 4 1 4
#> quant: age
#> units: 0.0564
#>
#> Min : -313.1656
#> 1st Qu.: -63.69352
#> Mean : -0.3926469
#> Median : -0.2099425
#> 3rd Qu.: 60.00334
#> Max : 329.0644
#> NAs : 0 %