Determines which of one or more phenotype IDs match the given filter.

phenotype_matches(x, studies)

Arguments

x

character, vector of phenotype IDs to test. A data.frame is allowed if it has a column labeled "id".

studies

character, vector of study IDs for which to test. A data.frame is allowed if it has a column labeled "id".

Value

a logical vector of the same length as the vector of phenotypes, with TRUE as element if the corresponding phenotype matches, and FALSE otherwise.

Details

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.

Examples

x <- get_phenotypes(entity = "basihyal bone") nrow(x)
#> [1] 20
# which of these are in the same study or studies as the first one? phenotype_matches(x, pk_get_study_list(phenotype = x$id[1]))
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE