Determines which of one or more phenotype IDs match the given filter.
phenotype_matches(x, studies)
character, vector of phenotype IDs to test. A data.frame is allowed if it has a column labeled "id".
character, vector of study IDs for which to test. A data.frame is allowed if it has a column labeled "id".
a logical vector of the same length as the vector of phenotypes, with TRUE as element if the corresponding phenotype matches, and FALSE otherwise.
At present, the only supported query filter is a list of studies (as their IDs). A phenotype matches if it is linked to at least one of the studies.
x <- get_phenotypes(entity = "basihyal bone")
nrow(x)
#> [1] 35
# which of these are in the same study or studies as the first one?
phenotype_matches(x, get_studies(phenotype = x$id[1]))
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> [25] FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE