| find_nodes {rsemmed} | R Documentation |
Search for nodes by name (exact match or using regular expressions)
or which match supplied semantic types. Perform anti-matching by
setting match = FALSE. Capitalization is ignored.
find_nodes(obj, pattern = NULL, names = NULL, semtypes = NULL, match = TRUE)
obj |
Either the SemMed graph or a node set ( |
pattern |
Regular expression used to find matches in node names |
names |
Character vector of exact node names |
semtypes |
Character vector of semantic types |
match |
If |
A vertex sequence of matching nodes
data(g_mini)
find_nodes(g_mini, pattern = "cortisol")
find_nodes(g_mini, pattern = "cortisol$")
find_nodes(g_mini, pattern = "stress")
find_nodes(g_mini, pattern = "stress") %>%
find_nodes(pattern = "disorder", match = FALSE)
find_nodes(g_mini, names = "Serum cortisol")
find_nodes(g_mini, names = "Chronic Stress")
find_nodes(g_mini, semtypes = "dsyn")
find_nodes(g_mini, semtypes = c("dsyn", "fndg"))
## pattern and semtypes are combined via OR:
find_nodes(g_mini, pattern = "cortisol", semtypes = "horm")
## To make an AND query, chain find_nodes sequenctially:
find_nodes(g_mini, pattern = "cortisol") %>%
find_nodes(semtypes = "horm")