View source: R/get_common_ids.R
get_common_ids | R Documentation |
For a set objects with IDs as row names (or, for a vector, just names), find the IDs that are present in all of the objects.
get_common_ids(..., complete.cases = FALSE)
... |
A set of objects: vectors, lists, matrices, data frames, and/or arrays. If one is a character vector with no names attribute, it's taken to be a set of IDs, itself. |
complete.cases |
If TRUE, look at matrices and non-character vectors and keep only individuals with no missing values. |
This is used (mostly internally) to align phenotypes,
genotype probabilities, and covariates in preparation for a genome
scan. The complete.cases
argument is used to omit
individuals with any missing covariate values.
A vector of character strings for the individuals that are in common.
x <- matrix(0, nrow=10, ncol=5); rownames(x) <- LETTERS[1:10]
y <- matrix(0, nrow=5, ncol=5); rownames(y) <- LETTERS[(1:5)+7]
z <- LETTERS[5:15]
get_common_ids(x, y, z)
x[8,1] <- NA
get_common_ids(x, y, z)
get_common_ids(x, y, z, complete.cases=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.