get_q_matrix: Return a single Q matrix from a 'gt_admix' object

View source: R/q_matrix.R

get_q_matrixR Documentation

Return a single Q matrix from a gt_admix object

Description

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

Usage

get_q_matrix(x, ..., k, run)

Arguments

x

A gt_admix object containing multiple Q matrices

...

Not used

k

The k value of the desired Q matrix

run

The run number of the desired Q matrix

Value

A single Q matrix from the gt_admix object

Examples

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

# Extract a Q matrix
get_q_matrix(admix_obj, k = 3, run = 1)

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