ggplot2 グラフの x ファセットと y ファセットの両方を再ラベル付けしようとしています。
1 つのファセットを再ラベル付けする関数を作成する複数の方法を見つけましたが、両方ではありません。
head(nh2)
RatioIncomePoverty Ethnicity Education mean.bmi
1 0 1 1 26.18333
2 0 1 1 30.88000
3 0 1 2 32.03000
4 0 1 4 34.45000
5 0 2 1 26.33000
6 0 2 2 23.44000
b2 <- qplot(RatioIncomePoverty, mean.bmi, data=nh2, facets=Education~Ethnicity)
b2 = b2 + labs(list(title="Average BMI and Ratio of Family Income to Poverty Threshold among US Ethnic groups", x = "Ratio of Family Income to Poverty Threshold", y = "Average BMI"))
b2
現在、教育と民族の両方にそれぞれ 1 ~ 5 の値があり、調査で対応したものに名前を変更したいと思います。
Education:
1 = "<9th"
2 = "9th-11th"
3 = "GED"
4 = "Some/AA"
5 = "Grad"
Ethnicity:
1 = "Mex/Amer"
2 = "OtherHisp"
3 = "White"
4 = "Black"
5 = "Other/Multi"