read_phen | R Documentation |
This function reads a standard *.phen file into a tibble.
It uses readr::read_table()
to do it efficiently.
GCTA and EMMAX use this format.
read_phen(file, verbose = TRUE)
file |
Input file (whatever is accepted by |
verbose |
If |
A tibble with columns: fam
, id
, pheno
.
GCTA PHEN format reference: https://cnsgenomics.com/software/gcta/#GREMLanalysis
# to read "data.phen", run like this: # phen <- read_phen("data") # this also works # phen <- read_phen("data.phen") # The following example is more awkward # because package sample data has to be specified in this weird way: # read an existing plink *.phen file file <- system.file("extdata", 'sample.phen', package = "genio", mustWork = TRUE) phen <- read_phen(file) phen # can specify without extension file <- sub('\\.phen$', '', file) # remove extension from this path on purpose file # verify .phen is missing phen <- read_phen(file) # load it anyway! phen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.