scale_y_discrete忽略中断/标签

geo*_*ory 3 r ggplot2

错误?可能与相关..

dat = data.frame(x = 1:4, y = ordered(c(4,'>5',1,1), levels = c(1:5, '>5')), grp = 1)

ggplot(dat, aes(x, y, group=grp)) + geom_step() + 
  scale_y_discrete(breaks = levels(dat$y), labels = levels(dat$y))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Rol*_*and 5

ggplot(dat, aes(x, y, group=grp)) + geom_step() + 
  scale_y_discrete(breaks = levels(dat$y), labels = levels(dat$y), drop = FALSE)
Run Code Online (Sandbox Code Playgroud)

结果情节