Skip to content
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

Apparent non-omnivores feeding at multiple trophic levels? #48

Open
Thomalpas opened this issue Mar 2, 2023 · 0 comments
Open

Apparent non-omnivores feeding at multiple trophic levels? #48

Thomalpas opened this issue Mar 2, 2023 · 0 comments

Comments

@Thomalpas
Copy link

Hi

I think there is a problem with the implementation of omnivory.

I see in the code that omnivores are defined as 'species that consume two or more species and have a non-integer trophic level', and this is indeed what has been coded.

However, it is possible for a species to consumer from multiple trophic levels and have an integer trophic level. I am not sure why such a species should not be considered an omnivore (is there a valid reason?)

I have a minimum reproducible example that displays this issue:

require(cheddar)

# 4 species
node = data.frame(node = c("s1", "s2", "s3", "s4"))

# Trophic links:
# In both scenarios s4 eats from 2 trophic levels

# Scenario 1: s2 eats s1, s3 eats s2, s4 eats s1 & s3
tlinks_1 = data.frame(resource = c("s1", "s2", "s1", "s3"), consumer = c("s2", "s3", "s4", "s4"))

# Scenario 2: s2 eats s1, s3 eats s2, s4 eats s2 & s3
tlinks_2 = data.frame(resource = c("s1", "s2", "s2", "s3"), consumer = c("s2", "s3", "s4", "s4"))

# Properties:
prop_1 = list(title = "4 eats 1 & 3")
prop_2 = list(title = "4 eats 2 & 3")

# Build communities using the 2 scenarios:
comm_1 = Community(nodes = node, trophic.links = tlinks_1, properties = prop_1)
comm_2 = Community(nodes = node, trophic.links = tlinks_2, properties = prop_2)

# Trophic levels:

# Scenario 1: s4 trophic level is integer
PreyAveragedTrophicLevel(comm_1)

# Scenario 1: s4 trophic level is non-integer
PreyAveragedTrophicLevel(comm_2)

# Omnivory:

# s4 eats s1 & s3, not omnivory
Omnivory(comm_1) # 0
# s4 eats s2 & s3, counts as omnivory
Omnivory(comm_2) # 0.25

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant