答案 0 :(得分:0)
您可以使用abbreviate
(和ggplot2)。
PCA
p <- prcomp(USArrests, scale=TRUE)
情节
library(ggbiplot)
library(ggrepel)
p1 <- ggbiplot(p) +
geom_text_repel(aes(label = rownames(USArrests)))
p2 <- ggbiplot(p) +
geom_text_repel(aes(label = abbreviate(rownames(USArrests), minlength = 1)))
library(patchwork)
p1 + p2 # compare the two plots
使用base R
biplot(p, xlabs = abbreviate(rownames(USArrests), minlength = 1))