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

Check for data.frame class in write_refs() too conservative? (rejects tibbles) #22

Open
LukasWallrich opened this issue Sep 26, 2022 · 0 comments

Comments

@LukasWallrich
Copy link

We are looking to use write_refs() in our ESHackathon/CiteSource package. For that, I was passing a tibble to write_refs and wondered why it fails - since it also has the data.frame class. This is because your check for classes depends on their precise position when there is more than one ... instead of

if(!any(c("bibliography", "data.frame") == class(x))) {

it might be better to use

if (inherits(x, "data.frame") || inherits(x, "bibliography"))

That would allow tibbles and generally be more robust ...

mjwestgate added a commit that referenced this issue Jul 4, 2023
- swap from `data.frame` to `tibble` format throughout package
- decommission `class() ==` syntax in favor of `inherits()` #22
- make `merge_columns()` a shell for `dplyr::bind_rows()`
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