ReadZmat {Eagle}R Documentation

Read Z matrix

Description

Read in the Z matrix that assigns groups/strains/lines to their trait measurements.

Usage

ReadZmat(filename = NULL)

Arguments

filename

contains the name of the Z matrix file. The file name needs to be in quotes. If the file is not in the working directory, then the full path to the file is required.

Details

The underlying linear mixed model is of the form

Y = X β + Z u_g + e

where Z is a (n x n_g) matrix that contains ones and zeros, n is the number of trait measurements, and n_g is the number of groups/strains/lines. If n and n_g are the same, then there is no need to specify Z. However, if a group/strain/line has multiple trait measurements (i.e. n > n_g) then the Z matrix is needed to tell Eagle which trait measurements belong to which groups/strains/lines.

A space separated text file is assumed. Each row of the matrix contains multiple zeroes but only a single one. The file cannot contain column or row headings. The file also cannot contain a row of only zeroes. Here, n must be larger than n_g otherwise an error will be issued.

Value

a data matrix is returned of the Z matrix.

See Also

ReadMarker and ReadPheno.

Examples

# Read in  example Z matrix from ./extdata/

# find the full location of the Z matrix data 
complete.name <- system.file('extdata', 'Z.txt', package='Eagle')
  
# read in Z matrix data 
Z_obj <- ReadZmat(filename=complete.name) 
                               
# look at first few rows of the Z matrix file
head(Z_obj)



[Package Eagle version 2.4.5 Index]