generate_random_matrix: Generate random matrix

View source: R/tad.R

generate_random_matrixR Documentation

Generate random matrix

Description

Generate and save random matrix

Usage

generate_random_matrix(
  weights,
  aggregation_factor = NULL,
  randomization_number,
  seed = NULL
)

Arguments

weights

the dataframe of weights, one row correspond to a series of observation

aggregation_factor

the dataframe of factor to take into account for the randomization

randomization_number

the number of random abundance matrix to generate

seed

the seed of the pseudo random number generator

Value

a data.frame of randomization_number observations

Examples

aggregation_factor_name <- c("Year", "Bloc")
weights_factor = TAD::AB[, c("Year", "Plot", "Treatment", "Bloc")]
aggregation_factor <- as.data.frame(
  weights_factor[, aggregation_factor_name]
)
random_matrix <- TAD::generate_random_matrix(
  weights = TAD::AB[, 5:102],
  aggregation_factor = aggregation_factor,
  randomization_number = 100,
  seed = 1312
)
head(random_matrix)

TAD documentation built on April 4, 2025, 5:10 a.m.