質問

I'm wondering what the best way is to eliminate certain factors from a plot in ggplot.

I have data that looks something like:

Group    Time    Freq
A        1       5000
B        1       70
C        1       60
...

I'm then using geom_path to plot how these frequencies change over time.

For all of the time periods, group A has far more observations than the other groups, so I'd like to create some graphs that do not include group A.

I'm wondering what the best way to do that is. Is there something I can pass to ggplot?

役に立ちましたか?

解決

Simplest thing is to filter the dataframe:

df[df$Group != "A",]

Or

subset(df, group!="A")
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top