ScientiaFelis / sebmsR

Swedish Butterflies - tools and apps
GNU Affero General Public License v3.0
2 stars 0 forks source link

Multiple years in sebms_species_per_sitetype_plot() fails due to naming issues, unclear if sql calls go through #29

Closed larspett closed 8 months ago

larspett commented 8 months ago

sebms_species_per_sitetype_plot(year=2018:2022) Attempting reconnect to db... Connected! Error in geom_segment(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 4th layer. Caused by error in data.frame(): ! arguments imply differing number of rows: 18, 20 Run rlang::last_trace() to see where the error occurred. Warning message: filename must have length 1, not length 5. ! Only the first, Species_per_site_2018.png, will be used. sebms_species_per_sitetype_plot(year=c(2018,2019)) Attempting reconnect to db... Connected! Error in geom_segment(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 4th layer. Caused by error in data.frame(): ! arguments imply differing number of rows: 18, 19 Run rlang::last_trace() to see where the error occurred. Warning message: filename must have length 1, not length 2. ! Only the first, Species_per_site_2018.png, will be used.

ScientiaFelis commented 8 months ago

This should be fixed now

larspett commented 8 months ago

Does work but we need more categories (51-55 and 55-60) if these exist (which they do in this combined data set). Also, the mean number of species per site look wrong (same number which it shouldn't (?) be and markers separated despite having the same number. This one is for 2010:2022

Image

ScientiaFelis commented 8 months ago

Yes, I was a bit questioning the mean number but can you check what it should be.

The numbers is separated in ggplot2() to not to overlap if the numbers are close.

Ok, hard to set categories dynamically I think. We can have them always to go to 55-60. It is basically those silly tickmarks between groups that makes everything harder.

ScientiaFelis commented 8 months ago

Unbelievable it did work quiet well now with more groups.

@larspett test both 2022 and 2010:2022

ScientiaFelis commented 8 months ago

Replace : with - in file names for windows