NEON-biodiversity / Ostats

O-statistics (community pairwise niche overlap statistics)

Home Page:https://neon-biodiversity.github.io/Ostats/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ostats_regional example

sydnerecord opened this issue · comments

Hi @qdread ,

I was working through Arya's example for ostats_regional in the vignette, but didn't feel as if the regional pool was specified correctly (i.e., it uses all years and sites). I wrote some other example code just trying to see how the HARV 2019 data compared to HARV and BART data from 2013-2018, but I could not get the code to run. Can you take a look at the ostats_regional example in the vignette and the code in the file entitled, "ostats_regional_example_sydne_notworking.R" in the vignette folder and see if you have any insights?

Thanks in advance for this. I spent quite a lot of time digging around in the code for the ostats_regional function, but felt that I was at the point where it would be good to reach out.

Thanks!
Sydne

Hi @sydnerecord, I am not sure that you committed the not-working code. I didn't see it in the folder. Maybe if it is not working you can create a branch for it and push to that branch?

Hi @qdread I created a branch called overlap_regional_testing and put the file entitled, "ostats_regional_example_sydne_notworking.R" in the vignette folder. Thanks for taking a look at this. Also, thanks for addressing those other issues recently.

Hi Sydne,
First, I think it is appropriate to include 2019 in the regional pool for each site, since the regional pool should include the local individuals as well. So I modified it to include that. That actually addresses the bug in the code, because there were some species in 2019 that were not present in other years. So, when it tried to sample individuals of that species from the regional pool, to equal the number of individuals present at the site, they weren't found in the regional pool, throwing an error.

From a code standpoint, that fixes the bug, but I think the underlying issue has to do with the data. The 2019 data for HARV and BART has individuals from a taxon PELEPEMA. I guess those are individuals that are unable to be distinguished between PELE and PEMA. It does not look like NEON used that classification in previous years. I'd just sidestep that weird thing by using 2018 as the example year and not 2019, if I was you, and just excluding 2019 from the data. No need to have to try to explain quirks in NEON's taxonomy over time in our package vignette, right?

I've committed some changes on your notworking.R file on the testing branch (Commit 7cb4b20). Let me know if you want me to modify anything in the main vignette.

Hi Quentin,
Good point on including the 2019 data - I had been thinking of it differently.

I agree no need to explain NEON's taxonomic changes, but will think about putting in an error message that will flag when the names of taxa in the local pool are not a subset of the regional pool.

Thanks!