ggplot2 の使用に問題があるようです。
aes_string を使用してボックス プロットをプロットしようとすると、次のエラーが発生します。
エラー: stat_boxplot には次の欠落している美学が必要です: x、y
次に例を示します。
x='group'
y='value'
df=data.frame(group=c('A','A','B','B','C','C'),value=c(1,2,3,4,5,6))
ggplot(data=df,aes_string(x,y)) + geom_boxplot() #returns the error
ggplot(data=df,aes(x,y)) + geom_boxplot() #plots nonsense (naturally)
ggplot(data=df,aes(group,value)) + geom_boxplot() #works, but not strings
これを文字列で機能させる方法について何か提案はありますか?