Skip to contents

Function to initialize the population from genomic data

Usage

initialize_population_cpp(genomic_data, population_size)

Arguments

genomic_data

Numeric matrix of genomic data where rows represent genes/features and columns represent samples.

population_size

Number of individuals in the population.

Value

Numeric matrix representing the initialized population.

Examples

# example of usage
genomic_data <- matrix(rnorm(100), nrow = 10, ncol = 10)
BioGA::initialize_population_cpp(genomic_data, population_size = 5)
#>           [,1]       [,2]     [,3]       [,4]      [,5]       [,6]       [,7]
#> [1,] -1.193641 -0.7517233 1.455841 -0.8286035 0.2897745 -0.4800535 -0.6048294
#> [2,] -1.193641 -0.7517233 1.455841 -0.8286035 0.2897745 -0.4800535 -0.6048294
#> [3,] -1.193641 -0.7517233 1.455841 -0.8286035 0.2897745 -0.4800535 -0.6048294
#> [4,] -1.193641 -0.7517233 1.455841 -0.8286035 0.2897745 -0.4800535 -0.6048294
#> [5,] -1.193641 -0.7517233 1.455841 -0.8286035 0.2897745 -0.4800535 -0.6048294
#>         [,8]      [,9]     [,10]
#> [1,] 1.46011 0.1496794 -1.433321
#> [2,] 1.46011 0.1496794 -1.433321
#> [3,] 1.46011 0.1496794 -1.433321
#> [4,] 1.46011 0.1496794 -1.433321
#> [5,] 1.46011 0.1496794 -1.433321