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 the usage of as.vector #74

Closed
elong0527 opened this issue Dec 6, 2021 · 0 comments
Closed

check the usage of as.vector #74

elong0527 opened this issue Dec 6, 2021 · 0 comments

Comments

@elong0527
Copy link
Collaborator

From CRAN maintainer

Dear maintainers,

This concerns the CRAN packages

Note that your package have started failing their checks with the latest development versions of R, 'R-devel' for short.

The reason is that we/I have introduced a new
as.vector.data.frame() method, and saying in NEWS

    • as.vector() gains a data.frame method which returns a
      simple named list, also obeying a long standing      
      ‘FIXME’ to enable as.vector(<data.frame>, mode="list").
      This will break code relying on 'as.vector(<data.frame>)' to
      return the unchanged data frame.

The last sentence applies to your respective packages where you call as.vector()  on a data frame -- which in R <= 4.1.x returns the data frame *unchanged* howeve now (in R-devel) returns a list (with the data frame
columns) but not a data frame anymore.
That's why your code now fails.
The solution will be to simply *NOT* call  as.vector(.) in that part of the code ..

Please let me/us know if you need help fixing your respective
package(s) to work flawlessly on the latest version of R, R-devel.
Note that this change will also make your code very slightly faster:
you should never have called as.vector(.) on a data frame: it does not do anything (but cost a few nanoseconds ..).
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