Description Usage Arguments See Also Examples
Requires the igraph
and ggraph
packages, which you
can install with install.packages(c("igraph", "ggraph"))
. Draws a
simple tree plot of the parse tree, showing parent-child relationships,
tokens and types.
The utility functions lexl_edges()
, lexl_vertices()
, and lexl_igraph()
compute each stage in plotting the final graph.
1 2 3 4 5 6 7 8 | ## S3 method for class 'lexl'
plot(x, ...)
lexl_edges(x)
lexl_vertices(x)
lexl_igraph(x)
|
x |
parse tree from |
... |
ignored, for consistency with the base |
lexl::lex_xl()
, lexl::demo_lexl()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | x <- lex_xl("MIN(3,MAX(2,A1))")
lexl_edges(x)
lexl_vertices(x)
if (interactive() && require(igraph, quietly = TRUE)) {
lexl_igraph(x)
}
if (interactive()
&& require(igraph, quietly = TRUE)
&& require(ggraph, quietly = TRUE)) {
plot(x)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.