Learn R Programming

tidypopgen (version 0.4.3)

q_matrix: 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)

Value

A q_matrix object

Arguments

x

A matrix or a data frame

Examples

Run this code
# 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)

Run the code above in your browser using DataLab