Learn R Programming

qtl2 (version 0.36)

read_pheno: Read phenotype data

Description

Read phenotype data from a CSV file (and, optionally, phenotype covariate data from a separate CSV file). The CSV files may be contained in zip files, separately or together.

Usage

read_pheno(
  file,
  phenocovarfile = NULL,
  sep = ",",
  na.strings = c("-", "NA"),
  comment.char = "#",
  transpose = FALSE,
  quiet = TRUE
)

Value

Either a matrix of phenotype data, or a list containing pheno (phenotype matrix) and phenocovar (phenotype covariate matrix).

Arguments

file

Character string with path to the phenotype data file (or a zip file containing both the phenotype and phenotype covariate files).

phenocovarfile

Character string with path to the phenotype covariate file. This can be a separate CSV or zip file; if a zip file, it must contain exactly one CSV file. Alternatively, if the file argument indicates a zip file that contains two files (phenotypes and phenotype covariates), then this phenocovarfile argument must indicate the base name for the phenotype covariate file.

sep

the field separator character

na.strings

a character vector of strings which are to be interpreted as NA values.

comment.char

A character vector of length one containing a single character to denote comments within the CSV files.

transpose

If TRUE, the phenotype data will be transposed. The phenotype covariate information is never transposed.

quiet

If FALSE, print progress messages.

See Also

Examples

Run this code
if (FALSE) {
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/main/Gough/gough_pheno.csv")
phe <- read_pheno(file)

phecovfile <- paste0("https://raw.githubusercontent.com/rqtl/",
                     "qtl2data/main/Gough/gough_phenocovar.csv")
phe_list <- read_pheno(file, phecovfile)
}

Run the code above in your browser using DataLab