Skip to content

is.numeric() check failing with tibble in fourthcorner function #22

Description

@AndyBunn

Hello, a colleague reached out for help with the fourthcorner function. I found that he was passing in a tibble and not a straight data.frame which causes the is.numeric() on line 85 of fourthcorner.R to return FALSE. But the is.data.frame(tabR) check on line 12 passes. E.g.,:

library(ade4)
library(dplyr)

data(aviurba)
# tabR
envVars <- aviurba$mil
#tabL
sppAbundances <- aviurba$fau
#tabQ
sppTraits <- aviurba$traits

foo <- fourthcorner(tabR = envVars,
                    tabL = sppAbundances,
                    tabQ = sppTraits,
                    nrepet=99)

envVars <- as_tibble(aviurba$mil)
bar <- fourthcorner(tabR = envVars,
                    tabL = sppAbundances,
                    tabQ = sppTraits,
                    nrepet=99)

Perhaps an as.data.frame coercion on tibbles would solve this.

Thanks for a great pacakge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions