-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modify dietSummaryByPrey() to account for analyses without the prey observed #1
Comments
Actually, it will not be appropriate to divide by the total number of other diet analyses in all cases, because some of those analyses may have been at a taxonomically coarse resolution (e.g. % animal vs % plant; or % insecta) where a given prey item could potentially be included but cannot be broken out. Thus, it seems the options are:
Concrete example:
If asked for a summary regarding the importance of caterpillars in the diet, the mean % occurrence returned should simply be 56.8%, rather than (56.8 + 0 + 0 + 0)/4 = 14%. |
Updated code now calculates a species mean using all studies that identified at least some prey down to the taxonomic level of the preyName. Thus, in the example above, Parrish and Blake & Loiselle would not be included in the calculation of mean. One potential problem would be a case that only identified arthropods down to "Insecta", but identified fruits down to Family. The current code would include that study in the count of studies to divide by even though "Lepidoptera" should not be considered to be 0% in that study. The most appropriate solution would be to identify the taxonomic entity immediately above preyName, and then include the study in the denominator only if there is at least one record of a prey item that belongs to a group at the level of preyLevel within that higher taxonomic entity. (E.g., if there was an entry for Coleoptera, but not Lepidoptera, then Lepidoptera could properly be interpreted as 0%.) |
Currently,
dietSummaryByPrey()
The problem is that this average does not take into account all of the analyses for the focal bird species where the specified prey item was not consumed at all.
Take the example of Cedar Waxwings consuming caterpillars:
They appear to be at the top of the list because there is one study with two analyses finding 84% and 89% caterpillars in the diet (a spruce budworm outbreak).
However,
speciesSummary()
Because there were 18 other diet analyses where caterpillars made up 0%, the species summary accurately suggests that caterpillars only make up 8.65%.
Dealing with this in
dietSummaryByPrey()
will be potentially be slow because we will have to almost rundietSummary()
for every bird species that has ever eaten the specified prey...The text was updated successfully, but these errors were encountered: