text_path: Display path (text form)

Description Usage Arguments Details Value See Also Examples

View source: R/display.R

Description

Show a text display of a path and obtain output that can be used to explore predications along the path. (A predication is a SUBJECT–LINKING VERB–>OBJECT triple.)

Usage

1
text_path(graph, path, print = TRUE)

Arguments

graph

The SemMed graph

path

A vertex sequence (igraph.vs) (the path to display)

print

Print the path to screen?

Details

text_path invisibly returns a list of tbl's containing information on the predications on the path. Each list element is a tbl that corresponds to a (sequential) pair of nodes along the path. The tbl contains information on the subject and object node's name and semantic type as well as all predicates linking the subject and object.

Value

Invisibly returns a list of predications for each pair of nodes along the path.

See Also

plot_path for plotting paths

Examples

1
2
3
4
5
6
7
data(g_mini)

node_cortisol <- find_nodes(g_mini, names = "Serum cortisol")
node_stress <- find_nodes(g_mini, names = "Chronic Stress")
paths <- find_paths(g_mini, from = node_cortisol, to = node_stress)
text_path(g_mini, paths[[1]][[1]])
result <- text_path(g_mini, paths[[1]][[1]], print = FALSE)

lmyint/rsemmed documentation built on July 26, 2021, 1:20 a.m.