vendredi 17 septembre 2021

How to plot a conditional histogram on R?

I am analysing the pokemon dataset on R. I would like to create a histogram about legendary pokemons in each generation. The dataset looks like this:

| Generation| Is_legendary  |
| 5         | 1             |
| 2         | 0             |

Is_legendary: 0 or 1 (1 means it is a legendary pokemon, 0 means it is not.)

I assume we have to embed a countif function?

Thanks a lot for any input

Aucun commentaire:

Enregistrer un commentaire