as_graph | R Documentation |
Produces a graph of log-ratios.
as_graph(object, ...)
## S4 method for signature 'LR'
as_graph(object)
## S4 method for signature 'ALR'
as_graph(object)
## S4 method for signature 'ILR'
as_graph(object)
object |
A |
... |
Currently not used. |
An igraph graph object.
N. Frerebeau
Other plot methods:
barplot()
,
hist()
,
plot()
,
plot_logratio
if (requireNamespace("igraph", quietly = TRUE)) {
library(igraph)
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Pairwise log-ratio
lr <- transform_lr(coda)
lr_graph <- as_graph(lr)
plot(lr_graph)
## Additive log-ratio
alr <- transform_alr(coda)
alr_graph <- as_graph(alr)
plot(alr_graph)
## Isometric log-ratio
ilr <- transform_ilr(coda)
ilr_graph <- as_graph(ilr)
plot(ilr_graph)
plr <- transform_plr(coda)
plr_graph <- as_graph(plr)
plot(plr_graph)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.