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

BIEN_trait_mean NA checking #17

Closed achmurzy closed 4 years ago

achmurzy commented 4 years ago

When I query some traits for particular species I get the following warning:

1: In mean(as.numeric(species_i_data[[1]][, 1])) : NAs introduced by coercion 2: In mean(as.numeric(species_i_data[[1]][, 1])) : NAs introduced by coercion

and I get NA values returned when there should be means available (based on the listed sample size):

first_species.txt

It looks like there is some kind of NA checking based on the source code for BIEN_trait_mean, but changing the 'mean' function calls to include 'na.rm = TRUE' might resolve this.

achmurzy commented 4 years ago

Added a pull request that resolves this issue. You can link the request to this issue or close it manually