-
Notifications
You must be signed in to change notification settings - Fork 18
adding .onAttach for smooth data loading #16
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
base: main
Are you sure you want to change the base?
Conversation
The issue appears to be with macos. Not sure what needs to be done here. |
* ci: Use stable pak * ci: Correctly detect branch protection * ci: Use Ubuntu 24.04 and styler PR * ci: Use Ubuntu 24.04 for fledge, squash * ci: Fix macOS (#16) * ci: Need to install R on Ubuntu 24.04 * ci: Need to install R on Ubuntu 24.04 for fledge * ci: Use styler from main branch * ci: Explicit permissions * ci: Ignore errors when removing pkg-config on macOS * ci: Use larger retry count for lock-threads workflow
@krlmlr - a gentle reminder about this :) Curious if this is going to be merged or not. |
Hello @benyamindsmith! Nice idea. Do you think users often load igraphdata without loading igraph first? In any case this reminds me of #16 |
Curious to hear what @schochastics @krlmlr think |
I think it is save to assume that if you use igraphdata, you will also have igraph loaded. However, I still think this is reasonable to merge since there might be use cases I do not see atm |
I personally have been doing development/scripting in R with This is what motivated my PR. Beyond my personal reason, I can't see why one would leave this out as using |
I do not feel qualified to state an opinion here since I am an R novice. But out of curiosity I tried to find other packages that do this and I could not. I looked here:
I do wonder why. Is it not a convenience during interactive work to have the autoload? I often end up loading igraphdata without loading igraph first, just out of forgetfulness. But it isn't really an issue as it seems perfectly fine to load igraph after loading the data and still use the datasets. |
There are other packages that do this, just not with igraph (at least my quick search turned out empty). You can check on the github repo of CRAN: |
Thanks. I now see what the problem is -- igraph is imported but the import isn't actually used when igraphdata is loaded. One way to make sure loading happens is to add #' @importFrom igraph V
NULL or similar. This adds an entry to |
@krlmlr could we get a sanity check on that to confirm that the |
igraphdata::karate |
When
igraphdata
is presently loaded. The data does not look nice when the library is called withoutigraph
. I added azzz.R
file and an.onAttach
function.Without .onAttach
With
.onAttach
This is a fix:
Let me know if this is helpful or not.