Generate a randomly or fixed sized FLQuant filled with normally distributed random numbers with a mean of 0. Used for automatic testing.

random_FLQuant_generator(
  fixed_dims = rep(NA, 6),
  min_dims = rep(1, 6),
  max_dims = pmax(min_dims, c(5, 10, 5, 4, 4, 5)),
  min_age_name = 1,
  sd = 100
)

Arguments

fixed_dims

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).

min_dims

A vector of length 6 with minimum size of each of the FLQuant dimensions. Default value is c(1,1,1,1,1,1).

max_dims

A vector of length 6 with maximum size of each of the FLQuant dimensions. Default value is c(5,10,5,4,4,5).

min_age_name

The name of the first age group.

sd

The standard deviation of the random numbers. Passed to rnorm() Default is 100.

Value

An FLQuant

Examples

flq <- random_FLQuant_generator()
dim(flq)
#> [1] 4 8 2 2 2 2
summary(flq)
#> An object of class "FLQuant" with:
#> 
#> dim:    age year unit season area iter 
#>         4   8    2    2      2    2 
#> units:  1.96 
#> 
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    %NAs 
#>    -270     -54      11      10      82     328       0 
flq <- random_FLQuant_generator(fixed_dims = c(NA,10,1,4,1,NA))
dim(flq)
#> [1]  2 10  1  4  1  3
summary(flq)
#> An object of class "FLQuant" with:
#> 
#> dim:    age year unit season area iter 
#>         2   10   1    4      1    3 
#> units:  0.531 
#> 
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    %NAs 
#>  -231.5   -66.4     2.5     3.5    72.9   283.0     0.0