vector1 <- c(1, 4, 5, 6, 2, 4, 5, 8)
vector2 <- c("level1", "level2", "level2", "level1", "level3", "level2", "level2", "level3")
dataframe <- data.frame(vector1, vector2)
dataframe$vector2 <- as.factor(dataframe$vector2)
plot <- ggplot(dataframe, aes(vector2, vector1))
plot +geom_bar(stat = "identity")
假设您在因子1中存在类不平衡,并且您希望专注于将第一因子隔离为单数条形图的条形图。如何才能使它成为x轴上显示的唯一级别?