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

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

Open
AndyBunn opened this issue Apr 24, 2020 · 1 comment
Open

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

AndyBunn opened this issue Apr 24, 2020 · 1 comment

Comments

@AndyBunn
Copy link

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.

@sdray
Copy link
Collaborator

sdray commented Apr 27, 2020

Thanks Andy for the report. I do not use tibble but I will think about it. The solution seems esay but I have to check if it will note introduce other bugs. Cheers

@aursiber aursiber changed the title is.numeric() check failing with tibble in fourthcorner funciton is.numeric() check failing with tibble in fourthcorner function May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants