pheno: Extract values from a population

View source: R/value_functions.R

phenoR Documentation

Extract values from a population

Description

Functions to extract phenotypic values, genotypic values, or predicted genotypic values.

Usage

pheno(pop, means = TRUE)

gv(pop)

pgv(pop)

meanG(pop)

varG(pop)

Arguments

pop

A 'pop' object.

means

For phenotypic data, should phenotypic means be returned, or all observations?

Details

pheno

Extract phenotypic values.

gv

Extract genotypic values.

pgv

Extract predicted genotypic values.

meanG

Calculate the average genotypic value.

varG

Calculate the population genetic variance.

Functions

  • gv:

  • pgv:

  • meanG:

  • varG:

Examples

# Simulate a genome
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

# Simulate a quantitative trait influenced by 50 QTL
qtl.model <- matrix(NA, 50, 4)
genome <- sim_gen_model(genome = genome, qtl.model = qtl.model, 
                        add.dist = "geometric", max.qtl = 50)
                        
# Simulate the population
pop <- sim_pop(genome = genome, n.ind = 100)
# Generate phenotypes
pop <- sim_phenoval(pop = pop, h2 = 0.5)


## Extract genotypic values
gv(pop)

## Extract phenotypic values
pheno(pop)

## Try to get predicted phenotypic values. There are none, so this returns \code{NULL}.
pgv(pop)

# Predict genotypic values
pop <- pred_geno_val(genome = genome, training.pop = pop, candidate.pop = pop)
# Now extract predicted genotypic values
pgv(pop)


neyhartj/pbsim documentation built on Nov. 11, 2023, 4:07 p.m.