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