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

Noisy message when loaded by quantmod #393

Closed
dmurdoch opened this issue Mar 1, 2023 · 3 comments
Closed

Noisy message when loaded by quantmod #393

dmurdoch opened this issue Mar 1, 2023 · 3 comments
Assignees
Milestone

Comments

@dmurdoch
Copy link

dmurdoch commented Mar 1, 2023

You are now printing a big ugly message in your .onAttach function about the conflict between stats::lag and dplyr::lag. That's a real issue, and it's a problem if I was using dplyr, but I'm not, I just have it installed. I'm not even attaching xts, I'm just importing quantmod, and quantmod attaches it. Don't you think that's excessive?

@dmurdoch
Copy link
Author

dmurdoch commented Mar 1, 2023

A suggestion: if dplyr is not already attached, just set a hook to give the message out if it is attached, e.g.

setHook(packageEvent("dplyr", "attach"), function(...) uglyMessage())

@joshuaulrich
Copy link
Owner

Hi Duncan, thanks for the report!

Don't you think that's excessive?

Yes, I agree it's excessive to print the warning when dplyr's installed but not being used. But I didn't have a better idea how to warn the user that attaching dplyr after attaching xts would be a problem. I really like your suggestion to use setHook() and I'll add that to the next release.

I'm not a huge fan of noisy package startup messages, but dplyr::lag() masking causes enough subtle issues that I thought it was worth being noisy and warning end users. Especially because the dplyr team could fix this but has shown no interest in doing so since they introduced this anti-social behavior.

I'd appreciate any other thoughts you have about how to only raise this warning when it's appropriate.

@joshuaulrich joshuaulrich added this to the 0.13.1 milestone Mar 1, 2023
@joshuaulrich joshuaulrich self-assigned this Mar 1, 2023
@joshuaulrich
Copy link
Owner

@dmurdoch I've implemented your suggestion and added it to the main branch. Please let me know if there's anything else we can do to make sure the warning is only shown at appropriate times.

Thanks again for the report and fix!

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

2 participants