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

Documentation and vignette for Ostats_multivariate

qdread opened this issue · comments

I just did a pull request of the branch where I was working on the hypervolume stuff, then merged it with the master branch.

So now the Ostats_multivariate() function is included in the main package. The internal functions pairwise_overlap() and community_overlap_merged() have also been modified so that they work with the multivariate data.

I think I already updated the documentation for the internal functions well enough. However, I did not really write any documentation for Ostats_multivariate(). We will need to do that. Much of it is possible to copy from Ostats().

Also, we may want to write a second vignette for multivariate. It should show how you can take a multivariate dataset and use Ostats() to individually get the overlap stats for each trait separately, and Ostats_multivariate() to get a hypervolume-based overlap stat for all traits together.

@yyue-r @isafluck Interested in helping with this?

I did a little bit of the documentation but still needs work ...

Another thing we'd need for the vignette is a good example dataset. We should use something relevant instead of the crappy iris dataset.

Just to update, I'm still looking for example datasets to use in the vignette, and the help documentation for Ostats_multivariate is not yet written. Hopefully I will be able to get to it soonish.

I've put an example data set into our shared G drive here. Let me know if you have any questions. We probably only need a subset of sites for the example data. It's a big data set that I'm working on a paper for, so let's not publish all the data with the vignette.

Thanks @sydnerecord! That's a big help. Of course if we end up using this in the vignette it'd only be a small and anonymized subset. I can even add random noise to the data if you want.

@sydnerecord I'm tagging you again here to see whether you would be able to take a look at the vignette outline I wrote, and add details or background about the pitcher plants. Also, I thought it would be a good idea to scale all the traits relative to pitcher width just so that they were more comparable among species (i.e. we are comparing shape and not just size). I just came up with that off the top of my head so if you have a more biologically informed idea for how to do that, that'd be great. The snippet of code where I took the ratios is here: https://github.com/NEON-biodiversity/Ostats/blob/master/vignettes/multivariate-Ostats.Rmd#L77-L83

@isafluck I also assigned you here per our discussion about adding some background out of the lit about niches/traits. For the vignette 1 paragraph is probably adequate, but more will be needed for the publication.

@qdread I'll take a look at the vignette outline and add details about the pitcher plants. Per your question about scaling the traits, we should take the approach that's been taken in the literature on these same traits for pitcher plants in the past for multivariate analyses: standardized (transformed into standard-
deviation units, or Z scores). Does that make sense to you?

Yes, I standardized them already. I also took ratios of everything divided by pitcher width just to remove size dependence of the traits, if that is not a correct way to do it please change! 😃

Commit f8ec818 adds documentation for the two multivariate functions. Maybe could also add an example for each? But mainly just the vignette needs to be done.

Just going through old issues getting ready to make a new cran release. I think we are good here, the vignette is complete for multivariate. So I am going ahead and closing this.