请如何在条形文本中插入回车(ggplot
2.0.9)
我试过了 :
mf_labeller <- function(var, value){
value <- as.character(value)
if (var=="Nerves") {
value[value=="xv1"] <- c("xv","/r", "1")
value[value=="xv2"] <- c("xv","/r", "2")
}
return(value)
}
facet_grid(..., labeller=mf_labeller)
它返回
Warning in value[value == "xv1"] <- c("xv","/r", "1") : number of items to replace is not a multiple of replacement length
Warning in value[value == "xv2"] <- c("xv","/r", "2") : number of items to replace is not a multiple of replacement length
图中只有“xv”“xv”
谢谢你的帮助