R/test_helper_functions.R
random_FLQuant_list_generator.Rd
Generate a list of FLQuant objects filled with normally distributed random numbers with a mean of 0. FLQuant objects can be randomly sized, depening on arguments passed to random_FLQuant_generator(). Used for automatic testing, particularly of the FLQuant7_base<T> class in CPP.
random_FLQuant_list_generator(min_elements = 1, max_elements = 10, ...)
A list of FLQuant objects
flq_list <- random_FLQuant_list_generator()
length(flq_list)
#> [1] 7
summary(flq_list)
#> Length Class Mode
#> [1,] 64 FLQuant numeric
#> [2,] 972 FLQuant numeric
#> [3,] 1280 FLQuant numeric
#> [4,] 750 FLQuant numeric
#> [5,] 540 FLQuant numeric
#> [6,] 3072 FLQuant numeric
#> [7,] 900 FLQuant numeric
lapply(flq_list, summary)
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 1 2 2 2 2 4
#> units: 0.719
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -283 -95 -27 -23 45 260 0
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 4 3 3 3 3 3
#> units: 0.839
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -324.4 -70.2 -2.6 -4.7 64.3 273.5 0.0
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 2 5 4 4 2 4
#> units: 0.109
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -375.09 -67.28 4.12 0.62 68.23 340.04 0.00
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 5 2 5 3 1 5
#> units: 1.09
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -304.99 -60.83 -2.40 0.39 62.82 293.08 0.00
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 3 5 3 3 1 4
#> units: 0.203
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -302.26 -71.09 -0.92 -4.55 66.77 303.11 0.00
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 3 4 4 4 4 4
#> units: 0.223
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -345.1 -66.3 1.7 1.8 70.0 389.8 0.0
#> An object of class "FLQuant" with:
#>
#> dim: age year unit season area iter
#> 2 5 5 3 2 3
#> units: 0.49
#>
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -330 -82 -11 -11 60 291 0
#> [[1]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -283.17160 -95.07873 -26.92292 -22.90430 44.76957 259.54712 0.00000
#>
#> [[2]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -324.373273 -70.174484 -2.582260 -4.693628 64.288537 273.525592
#> %NAs
#> 0.000000
#>
#> [[3]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -375.0919831 -67.2799887 4.1207565 0.6247289 68.2334480 340.0360063
#> %NAs
#> 0.0000000
#>
#> [[4]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -304.9919848 -60.8267539 -2.3966753 0.3853831 62.8154516 293.0776699
#> %NAs
#> 0.0000000
#>
#> [[5]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -302.2624548 -71.0940732 -0.9210084 -4.5523424 66.7707597 303.1069101
#> %NAs
#> 0.0000000
#>
#> [[6]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -345.083660 -66.290923 1.653730 1.848905 69.986567 389.825049
#> %NAs
#> 0.000000
#>
#> [[7]]
#> Min. 1st Qu. Median Mean 3rd Qu. Max. %NAs
#> -330.02584 -81.53028 -10.62492 -10.55916 60.27597 290.74198 0.00000
#>