plotIndicatorsReconstruction {cfda} | R Documentation |
Plot reconstructed indicators
Description
Plot reconstructed indicators
Usage
plotIndicatorsReconstruction(reconstruction, id, states = NULL)
Arguments
reconstruction |
output of |
id |
id of the individual to plot. |
states |
states to plot, by default all states are plotted |
Value
ggplot
Author(s)
Quentin Grimonprez
See Also
Examples
set.seed(42)
# Simulate the Jukes-Cantor model of nucleotide replacement
K <- 3
Tmax <- 1
d_JK <- generate_Markov(n = 100, K = K, Tmax = Tmax)
d_JK2 <- cut_data(d_JK, Tmax)
# create basis object
m <- 20
b <- create.bspline.basis(c(0, Tmax), nbasis = m, norder = 4)
# compute encoding
encoding <- compute_optimal_encoding(d_JK2, b, computeCI = FALSE, nCores = 1)
indicators <- reconstructIndicators(encoding)
# we plot the first path and its reconstructed indicators
iInd <- 3
plotData(d_JK2[d_JK2$id == iInd, ])
plotIndicatorsReconstruction(indicators, id = iInd)
# the column state contains the state associated with the greatest indicator.
# So, the output can be used with plotData function
plotData(remove_duplicated_states(indicators[indicators$id == iInd, ]))
[Package cfda version 0.12.0 Index]