View source: R/get-save-infos.R
snp_getSampleInfos | R Documentation |
Get information of individuals by matching from an external file.
snp_getSampleInfos(
x,
df.or.files,
col.family.ID = 1,
col.sample.ID = 2,
col.infos = -c(1, 2),
pair.sep = "-_-",
...
)
x |
A bigSNP. |
df.or.files |
Either
|
col.family.ID |
Index of the column containing the family IDs to match with those of the study. Default is the first one. |
col.sample.ID |
Index of the column containing the sample IDs to match with those of the study. Default is the second one. |
col.infos |
Indices of the column containing the information you want. Default is all but the first and the second columns. |
pair.sep |
Separator used for concatenation of family and sample IDs to
make unique IDs for matching between the two datasets. Default is |
... |
Any additional parameter to pass to |
The requested information as a data.frame
.
list.files
test <- snp_attachExtdata()
table(test$fam$family.ID)
# Get populations clusters from external files
files <- system.file("extdata", paste0("cluster", 1:3), package = "bigsnpr")
bigreadr::fread2(files[1])
bigreadr::fread2(files[1], header = FALSE) # need header option here
infos <- snp_getSampleInfos(test, files, header = FALSE)
table(infos[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.