Pergunta

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?

Foi útil?

Solução

Simplest thing is to filter the dataframe:

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

Or

subset(df, group!="A")
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top