adeverse / adegraphics

An S4 Lattice-Based Package for the Representation of Multivariate Data
https://adeverse.github.io/adegraphics/
9 stars 1 forks source link

Bug in 'addtext' when the ADEgS is a superposition #2

Open aursiber opened 8 years ago

aursiber commented 8 years ago

Three examples that don't work.

library(adegraphics) data(granulo, package = "ade4") df <- data.frame(t(apply(granulo$tab, 1, function(x) x / sum(x)))) pca <- ade4::dudi.pca(df, scal = FALSE, scan = FALSE)

g1 <- s.arrow(ade4::dudi.pca(data.frame(df), scan = F, nf = 2)$co, plot = FALSE) g2 <- s.label(pca$li, plabels.cex = 0.5, plabels.col = "blue", plot = FALSE) g3 <- add.ADEg(g2)

addtext(g3, -0.9, -0.2, "Data Granulo", plabels.cex = 1.2, which = 1) # error : unable to find an inherited method for function ‘printSuperpose’ for signature ‘"S2.label", "ADEgS"’ addtext(g3, -0.5, -0.1, "Data Granulo", plabels.cex = 1.2, which = 2) # doesn't work addtext(g3, -0.9, -0.2, "Data Granulo", plabels.cex = 1.2, which = 1:2) # doesn't work

thioulouse commented 6 years ago

Another example I would like to use: pl1 <- plot(as.randtest(sim = rnorm(100), obs = 1.6)) addtext(pl1, 2, 25, "P-value = 0.194")