-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
deal with tibbles and 1 column data frames gracefully #169
Comments
This seems like a good thing overall. Two questions:
|
|
It could also throw a mandatory warning that tells the user that it's converting |
That all sounds very good. I've now dog-fooded the package a fair amount, and I'm thinking about preparing a release for CRAN using the major improvements we've implemented. Do you think we should sneak this change in before I hit "GO"? Any other easy changes to make before release? |
There are a few regex improvements that I could probably get around to in the next week or so. |
Cool. No rush. |
My thinking on this has evolved. I now believe that we should not convert inputs automagically, but that we should rather build in input checks and exit gracefully with a warning and instructions on common fixes. |
We could add here something like...
to essentially cast a single column tibble or data frame (or single element list) to a vector and avoid the following warning, i.e.
sourcevar must be a character or numeric vector. This error often arises when users pass a tibble (e.g., from dplyr) instead of a column vector from a data.frame (i.e., my_tbl[, 2] vs. my_df[, 2] vs. my_tbl[[2]])
.Not 100% sure that's the best thing, so leaving this here simply as an idea.
The text was updated successfully, but these errors were encountered: