library(ade4)Registered S3 methods overwritten by 'ggpp':
method from
heightDetails.titleGrob ggplot2
widthDetails.titleGrob ggplot2
data(dunedata)
acp1 <- dudi.pca(df = dunedata$veg, scannf = FALSE)library(ade4)Registered S3 methods overwritten by 'ggpp':
method from
heightDetails.titleGrob ggplot2
widthDetails.titleGrob ggplot2
data(dunedata)
acp1 <- dudi.pca(df = dunedata$veg, scannf = FALSE)s.label with ggplot2(gg1 <- s_gg.label(acp1$li))
# Details about layers
names(gg1$layers)[1] "geom_hline" "geom_vline" "geom_label"
gg1$layers$geom_hline <- NULL
gg1
names(gg1$layers)[1] "geom_vline" "geom_label"
gg2 <- s_gg.label(acp1$li)
gg2$layers$geom_hline$aes_params$colour <- 2 # Horizontal axis in red
gg2$layers$geom_vline$aes_params$colour <- 3 # Vertical axis in green
gg2$layers$geom_vline$aes_params$size <- 2 # Vertical axis wider
gg2
gg3 <- s_gg.label(acp1$li)
# All points in black except numbers 2, 5, 6, 7 and 10 in red
col1 <- rep(1, 20)
col1[c(2, 5, 6, 7, 10)] <- rep(2, 5)
gg3$layers$geom_label$aes_params$colour <- col1
gg3$layers$geom_label$aes_params$fill <- "lightblue" # Background color
gg3
library(ggplot2)
data(banque)
dudi1 <- dudi.acm(banque, scannf = FALSE)
ggbanque <- s_gg.label(dudi1$li)
# Add title and subtitle
ggbanque + ggplot2::labs(title = "Factorial map from ACM", subtitle = "Here is a subtitle")
# Remove x-axis title
ggbanque + ggplot2::labs(x = NULL)
# Update y-axis title
ggbanque + ggplot2::labs(y = "My new title for y-axis")
s.arrow with ggplot2(ga1 <- s_gg.arrow(cbind.data.frame(runif(55,-2,3), runif(55,-3,2))))
names(ga1$layers)[1] "geom_hline" "geom_vline" "geom_segment" "geom_label_repel"
ga1$layers$geom_hline <- NULL
ga1$layers$geom_vline <- NULL
ga1
s.class with ggplot2xy <- cbind.data.frame(x = runif(200, -1, 1), y = runif(200, -1, 1))
posi <- factor(xy$x > 0) : factor(xy$y > 0)
coul <- c("black", "red", "green", "blue")
s.class(xy, posi)
gs1 <- s_gg.class(xy, posi) # by default, each level is colored
gs1
cols <- c("FALSE:TRUE" = "red", "TRUE:TRUE" = "blue", "FALSE:FALSE" = "black", "TRUE:FALSE" = "green")
gs1 + ggplot2::scale_colour_manual(values = cols)