plotEigenvalues {cfda}R Documentation

Plot Eigenvalues

Description

Plot Eigenvalues

Usage

plotEigenvalues(x, cumulative = FALSE, normalize = FALSE, ...)

Arguments

x

output of compute_optimal_encoding function

cumulative

if TRUE, plot the cumualtive eigenvalues

normalize

if TRUE eigenvalues are normalized for summing to 1

...

geom_point parameters

Value

a ggplot object that can be modified using ggplot2 package.

Author(s)

Quentin Grimonprez

See Also

plot.fmca plotComponent

Examples

# Simulate the Jukes-Cantor model of nucleotide replacement  
K <- 4
Tmax <- 6
PJK <- matrix(1/3, nrow = K, ncol = K) - diag(rep(1/3, K))
lambda_PJK <- c(1, 1, 1, 1)
d_JK <- generate_Markov(n = 10, K = K, P = PJK, lambda = lambda_PJK, Tmax = Tmax)
d_JK2 <- cut_data(d_JK, Tmax)

# create basis object
m <- 6
b <- create.bspline.basis(c(0, Tmax), nbasis = m, norder = 4)


# compute encoding
encoding <- compute_optimal_encoding(d_JK2, b, computeCI = FALSE, nCores = 1)

# plot eigenvalues
plotEigenvalues(encoding, cumulative = TRUE, normalize = TRUE)

# modify the plot using ggplot2
library(ggplot2)
plotEigenvalues(encoding, shape = 23) +
   labs(caption = "Jukes-Cantor model of nucleotide replacement")



[Package cfda version 0.9.9 Index]