If you write out the argument names you're putting into ggplot, you'll see why your code is wrong.
ggplot(data = GGplot_Test, mapping = aes(x = Event, y = Duplications)) + geom_boxplot()
To use ggplot
you'll first need to convert your data into tidy long format. You're going to want to use tidyr::pivot_longer
to get a grouping column. Also, it seems your data is only for one species e.g. arenavirdae.
So, first, use pivot_longer()
to get data that looks like this
name value
Cospeciation 3
Cospeciation 3
Cospeciation 3
Cospeciation 5
...
Duplications 4
Duplications 3
...
Then you can use ggplot
ggplot(data = GGplot_Test, mapping = aes(x = name, y = value)) + geom_boxplot()
and if you can combine your data so that it looks like
species name value
Arena Cospeciation 3
Arena Cospeciation 3
Arena Cospeciation 3
Arena Cospeciation 5
...
Arena Duplications 4
Arena Duplications 3
...
Ateri Cospeciation 6
Ateri Cospeciation 5
Ateri Cospeciation 4
Ateri Cospeciation 5
...
Ateri Duplications 6
Ateri Duplications 5
...
then you can use facets in ggplot to get all the graphs
ggplot(data = GGplot_Test, mapping = aes(x = name, y = value)) + geom_boxplot() + facet_wrap(cols = vars(species))
Finally, if you paste in your data (copy and paste the results of dput(head(Ggplot_Test))
as @r2evans suggested), then we could help much more easily.