inbo / alien-species-portal

Portal for alien and invasive species indicators
MIT License
0 stars 0 forks source link

Create "Trend occupancy union-list species" #16

Open mvarewyck opened 2 years ago

mvarewyck commented 2 years ago

Could you provide the trias function to create the plot on slide 11 of the mockup

SanderDevisscher commented 2 years ago

@mvarewyck its not really a trias function. The graph compares the no infected squares between the baseline & the 1st reporting cycle. I left some code examples in the notes of the mockup.

mvarewyck commented 2 years ago

Screenshot from 2022-05-20 15-56-28

Questions/Notes

SanderDevisscher commented 2 years ago

Screenshot from 2022-05-20 15-56-28

Questions/Notes

  • I don't have the same data as in Sander's example scripts: In the scripts there are csv files. The zenodo links point to shape/geojson files

The zenodo files are the official baseline & rapportage => you should use these

  • Currently latin name of species in data

You need a translation key ?

  • For t0 data: should we only keep records with 'Accepted' == "Y"? In plot above, we keep all

You should keep 'Accepted' == "Y" & 'Accepted' == "NEW" these indicate the 10x10km squares provided by europe we considered correct & those we added in. In Case of the rapportage we decided to just overwrite Europe the squares in the t1 are thus all "NEW" or "Y".

  • How to make distinction between 'sporadisch' and 'gevestigd' in example plot? Variable 'Accepted' is only available in t0 data

this is an arbitrary value => @timadriaens which number of squares should be the threshold ? Is this distinction necessary ?

  • For t0 data: can we simply row-bind all records for the 3 years (2016-2020)?. No check for duplicates?

?? the graph should display no unique squares per species for each period (t0 & t1)

  • How to calculate percentages (currently Aantal)? Total no. of cells fixed over the years? not in t0 data

The total no 10x10km squares is 370. Percentages should be calculated compared to 370.

> sapply(data_t0, function(x) length(x@polygons))
[1] 1670 1607  310
mvarewyck commented 2 years ago

?? the graph should display no unique squares per species for each period (t0 & t1)

I was not looking for unique squares, fixed now. And period is that t0 or t1? Or is period the t0 year? Because in the plot the year is not indicated So, what I'm doing is removing all duplicate rows in these data and next count frequency of cellcodes per species and source

> head(allData)
                 species source     cellcode
3      Trachemys scripta     t0 10kmE380N310
4    Pseudorasbora parva     t0 10kmE380N311
5   Ludwigia grandiflora     t0 10kmE380N312
6 Myriophyllum aquaticum     t0 10kmE380N312
7  Baccharis halimifolia     t0 10kmE380N313
8     Orconectes limosus     t0 10kmE380N313