PLNPCAfit
objectR/PLNPCAfit-S3methods.R
plot.PLNPCAfit.Rd
PCA visualization (individual and/or variable factor map(s)) for a PLNPCAfit
object
an R6 object with class PLNPCAfit
the type of output for the PCA visualization: either "individual", "variable" or "both". Default is "both".
scalar: the number of axes to be considered when map = "both"
. The default is min(3,rank)
.
numeric, the axes to use for the plot when map = "individual"
or map = "variable"
. Default it c(1,min(rank))
a character, factor or numeric to define the color associated with the individuals. By default, all variables receive the default color of the current palette.
a character, factor or numeric to define the color associated with the variables. By default, all variables receive the default color of the current palette.
logical. Should the plot be displayed or sent back as ggplot
object
character. A title for the single plot (individual or variable factor map). If NULL (the default), an hopefully appropriate title will be used.
Not used (S3 compatibility).
displays an individual and/or variable factor maps for the corresponding axes, and/or sends back a ggplot
or gtable object
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPCAs <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:5)
#>
#> Initialization...
#>
#> Adjusting 5 PLN models for PCA analysis.
#> Rank approximation = 5
Rank approximation = 2
Rank approximation = 1
Rank approximation = 3
Rank approximation = 4
#> Post-treatments
#> DONE!
myPCA <- getBestModel(myPCAs)
if (FALSE) { # \dontrun{
plot(myPCA, map = "individual", nb_axes=2, ind_cols = trichoptera$Group)
plot(myPCA, map = "variable", nb_axes=2)
plot(myPCA, map = "both", nb_axes=2, ind_cols = trichoptera$Group)
} # }