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

ns-qualify methods in namespace top level #1589

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelChirico
Copy link
Contributor

Closes #1588

@IrshadUlHaq1 I really think this is a {pak} issue, many packages will encounter this issue since it's not something enforced anywhere else in R.

It's also something that's handled inconsistently even within {dbplyr}, which is evidence that tooling to prevent backsliding when fixing this issue is nonexistent:

dbplyr/R/zzz.R

Lines 6 to 8 in 5726930

methods::setOldClass(c("ident_q", "ident", "character"), ident_q())
methods::setOldClass(c("ident", "character"), ident())
methods::setOldClass(c("sql", "character"), sql())

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@MichaelChirico
Copy link
Contributor Author

There are 100s of CRAN packages which don't do methods::-qualification on this function alone (not to mention many other similar issues of assuming the default set of packages under R CMD build):

https://github.com/search?q=org%3Acran+%2F%28%5E%7C%5B%5E%3A%5D%29setOldClass%5C%28%2F+lang%3AR&type=code

@IrshadUlHaq1
Copy link

IrshadUlHaq1 commented Mar 12, 2025

@MichaelChirico What is your advice for me on how to get rid of this once and for all?

Even the install.packages("dbplyr") is throwing the same error.

@MichaelChirico
Copy link
Contributor Author

Hm, can you report Sys.getenv("R_DEFAULT_PACKAGES")? Maybe you have wound up with set unusually somehow.

@IrshadUlHaq1
Copy link

IrshadUlHaq1 commented Mar 12, 2025

You were right:

Sys.getenv("R_DEFAULT_PACKAGES")
[1] "utils,grDevices,graphics,stats"

R is not explicitly telling me that I have messed up my ~/.Renviron . I commented # the R_DEFAULT_PACKAGES in my ~/.Renviron and everything is up and running normally. Thank you @MichaelChirico for solving this for me, and for teaching me.

@MichaelChirico
Copy link
Contributor Author

Great, glad it's resolved! I wonder how that happened, it's a really baroque setting!

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

Successfully merging this pull request may close these issues.

Error while installing tidyverse
2 participants