ggplot2
でデータをプロットする際に少し問題があります:AdultInputProp
にfacet_wrap
を使用しますが、Rは変数を見つけられません。代わりにError in as.quoted(facets) : object 'AdultInputProp' not found
を返します。今私はggplot2
の代わりに同じ変数を使用してshape
のスケールを作成してもらうと、Rがプロットするデータセットでこの変数を見つけることができないことを意味しています。どのような問題が起こっているのでしょうか?ggplot2 facet_wrapは変数を見つけられませんが形状はありません
申し訳ありませんが、ゼロから生成されたdfを使用して最小限の作業例を作成する方法があまりにもわかりません。したがって、the df I'm usingとコードがあります。私もfacet_wrap
の代わりにfacet_grid
を使ってみましたが、同じ問題が発生しました。
ここでファセットを有するコードは、上記のエラーを返します:
df.plot.GBPperAIP <- ggplot(df.sum.GBPperAIP,
aes(x=TestIteration, y=Error,
colour=GoalBabblingProp,
group=interaction(GoalBabblingProp,
AdultInputProp))) +
facet_wrap(AdultInputProp) +
xlab("Step") + ylab("Mean error") + theme_bw(base_size=18) +
scale_colour_discrete(name = "Goal babbling proportion") +
geom_line(position = position_dodge(1000)) +
geom_errorbar(aes(ymin=Error-ci,
ymax=Error+ci),
color="black", width=1000,
position = position_dodge(1000)) +
geom_point(position = position_dodge(1000),
size=1.5, fill="white")
削除facet_wrap
ラインを除くとshape
と全く同じこの他のコードは、罰金作品を追加しました:
df.plot.GBPperAIP <- ggplot(df.sum.GBPperAIP,
aes(x=TestIteration, y=Error,
colour=GoalBabblingProp,
shape=AdultInputProp,
group=interaction(GoalBabblingProp,
AdultInputProp))) +
xlab("Step") + ylab("Mean error") + theme_bw(base_size=18) +
scale_colour_discrete(name = "Goal babbling proportion") +
geom_line(position = position_dodge(1000)) +
geom_errorbar(aes(ymin=Error-ci,
ymax=Error+ci),
color="black", width=1000,
position = position_dodge(1000)) +
geom_point(position = position_dodge(1000),
size=1.5, fill="white")
'facet_wrap(〜AdultInputProp)' – eipi10