bmaitner / RBIEN

Tools for accessing the Botanical Information and Ecology Network (BIEN) database
http://bien.nceas.ucsb.edu/bien/
Other
43 stars 10 forks source link

How can we match all the traits for each species at each site? #31

Open hms1664002057 opened 2 years ago

hms1664002057 commented 2 years ago

Hi @bmaitner,How can I match all traits for each species per site? I want to explore the scaling relationships among traits using the “BIEN ”package. Can you give an example of the code? thank you.

Rekyt commented 2 years ago

I'm jumping in here to help because I think @hms1664002057 that you can refer to "BIEN tutorial" (https://cran.r-project.org/web/packages/BIEN/vignettes/BIEN_tutorial.html) to see example of code using the BIEN package.

hms1664002057 commented 2 years ago

@Rekyt ,Thank you for your help, but "BIEN tutorial" (https://cran.r-project.org/web/packages/BIEN/vignettes/BIEN_tutorial.html) does not give code for matching multiple traits of the same species in the same site , and does not say whether it is possible to match based on the same ID (like the plant trait database does). Can we match traits based on the same species at the same site (longitude, latitude, altitude)?

Rekyt commented 2 years ago

I'm not sure to understand your use case. I'm also not so familiar of extracting trait data from BIEN using spatial coordinates.

For sure, if you extract trait data using target species with BIEN::BIEN_trait_species() you can always filtered based on unique latitude and unique longitude to get back the identity of the species.

But from what I know of BIEN, it doesn't seem possible to uniquely link different trait values down to the same individual. You could link them to the same area (using the coordinates in the returned table), but never back at the individual scale.

hms1664002057 commented 2 years ago

@Rekyt ,Thank you for your valuable advice. Can we match the traits of the same plants in the same site (the same latitude, longitude and height) according to the code here? Code link: https://github.com/MarconiS/Disentangling-the-role-of-phylogeny-and-climate-on-joint-leaf-trait-distributions-across-Eastern-Uni/blob/50f11f089be6e549930128caae54b295228e08e0/src/model_training/get_bien_data.R

Rekyt commented 2 years ago

Yes, that's exactly what I've told you. Using unique species names, unique latitude, longitude, and elevation. You should be able to match back species from the same site. However, this will only match at the species level locally because they are no identifier at the individual scale.

hms1664002057 commented 2 years ago

@Rekyt ,Thank you for your continued reply and help. I have learned a lot from your reply. We should keep communicating and learning, so as to explore more usage of BIEN package. Thank you.

hms1664002057 commented 2 years ago

Hi, @Rekyt. Have you used the data from the plant trait database (TRY)? Can we convert the long data form in the TRY to the wide data form and match the same species in the same location (latitude, longitude, altitude) based on the "ObservationID" column in the TRY? Do you have code or information on this? Thank you.

Rekyt commented 2 years ago

This is not related to BIEN and the use of RBIEN so I would suggest this conversation continues elsewhere then in this issue.

Regarding TRY structure you should look for specific code using TRY strucutre. Matching individual level traits maybe possible but you should check carefully.