How to change facet labels?

后端 未结 20 1651
既然无缘
既然无缘 2020-11-22 14:50

I have used the following ggplot command:

ggplot(survey, aes(x = age)) + stat_bin(aes(n = nrow(h3), y = ..count.. / n), binwidth = 10)
  + scale         


        
20条回答
  •  名媛妹妹
    2020-11-22 15:30

    I think all other solutions are really helpful to do this, but there is yet another way.

    I assume:

    • you have installed the dplyr package, which has the convenient mutate command, and
    • your dataset is named survey.

      survey %>% mutate(Hosp1 = Hospital1, Hosp2 = Hospital2,........)

    This command helps you to rename columns, yet all other columns are kept.

    Then do the same facet_wrap, you are fine now.

提交回复
热议问题