q_matrix: Convert a standard matrix to a 'q_matrix' object

View source: R/q_matrix.R

q_matrixR Documentation

Convert a standard matrix to a q_matrix object

Description

Takes a single Q matrix that exists as either a matrix or a data frame and returns a q_matrix object.

Usage

q_matrix(x)

Arguments

x

A matrix or a data frame

Value

A q_matrix object

Examples

# Read in a single .Q file
q_mat <- read.table(system.file("extdata", "anolis", "anolis_ld_run1.3.Q",
  package = "tidypopgen"
))
class(q_mat)

# Convert to a Q matrix object
q_mat <- q_matrix(q_mat)
class(q_mat)


tidypopgen documentation built on Jan. 23, 2026, 1:06 a.m.