Skip to content

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

@Thomalpas

Description

@Thomalpas

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions