get_p_matrix: Return a single P matrix from a 'gt_admix' object

View source: R/q_matrix.R

get_p_matrixR Documentation

Return a single P matrix from a gt_admix object

Description

This function retrieves a single P matrix from a gt_admix object based on the specified k value and run number.

Usage

get_p_matrix(x, ..., k, run)

Arguments

x

A gt_admix object containing P matrices

...

Not used

k

The k value of the desired P matrix

run

The run number of the desired P matrix

Value

A single P matrix from the gt_admix object

Examples

# Read example gt_admix object
admix_obj <-
  readRDS(system.file("extdata", "anolis", "anole_adm_k3.rds",
    package = "tidypopgen"
  ))

# Extract a P matrix
get_p_matrix(admix_obj, k = 3, run = 1)

tidypopgen documentation built on Aug. 28, 2025, 1:08 a.m.