read_ind | R Documentation |
This function reads a standard Eigenstrat *.ind file into a tibble.
It uses readr::read_table()
to do it efficiently.
read_ind(file, verbose = TRUE)
file |
Input file (whatever is accepted by |
verbose |
If |
A tibble with columns: id
, sex
, label
.
Eigenstrat IND format reference: https://github.com/DReichLab/EIG/tree/master/CONVERTF
# to read "data.ind", run like this: # ind <- read_ind("data") # this also works # ind <- read_ind("data.ind") # The following example is more awkward # because package sample data has to be specified in this weird way: # read an existing Eigenstrat *.ind file file <- system.file("extdata", 'sample.ind', package = "genio", mustWork = TRUE) ind <- read_ind(file) ind # can specify without extension file <- sub('\\.ind$', '', file) # remove extension from this path on purpose file # verify .ind is missing ind <- read_ind(file) # load it anyway! ind
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.