-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix a bunch of R CMD check warnings and notes #27
Conversation
Very possible—I never set up proper package infra for this package, just modified it to use SVGs!
I recall having problems with |
The How can I install it? |
https://sjp.co.nz/projects/grconvert/ But I only have access to Windows machines... so I can't recreate the data. If you could find time to either attempt to open the existing data in RStudio see if it works, or run again the data script, it would be helpful in helping me unblock and move to the next steps. |
Ok it seems like the last change I made fixes all remaining warnings and notes. Locally, I get:
Tested with my package also and it works. If you could merge that, I think it would be a great start. |
Amazing! I'll look at merging this in tonight and adding ggflags to my R-Universe. I have a Mac, so I can potentially install |
Head up that I'm going to use this chance to set up R-Universe and also change the defualt branch from master to main, so I'll:
|
Also @rempsyc, I'd love to add you to the package authors! Is that okay? Do you have an email address and/or ORC-ID you'd like me to list? |
Thanks, I appreciate it! You can use my info from here: https://github.com/easystats/effectsize/blob/main/DESCRIPTION |
Good idea, can't wait to be able to install the new version on the main branch so my own R CMD check stops failing :D |
So I'm running the devtools::load_all()
# ℹ Loading ggflags
set.seed(1234)
d <- data.frame(x=rnorm(50), y=rnorm(50),
country=sample(c("ar","fr", "nz", "gb", "es", "ca", "lv", "qa"), 50, TRUE),
stringsAsFactors = FALSE)
ggplot(d, aes(x=x, y=y, country=country, size=x)) +
geom_flag() +
scale_country() +
scale_size(range = c(0, 15)) Is that the case for you as well, @rempsyc? |
It looks like |
Have tried adding |
Okay, we're in business now! Added the |
Confirmed |
Wouhouu, congrats and thanks!! Great work |
Thanks again for all your work here! |
Ok I just tried it with my package with the latest version. The good news is that it seems to have fixed my R CMD check. However, it seems the line Error in h(simpleError(msg, call)) :
error in evaluating the argument 'object' in selecting a method for function 'grobify': object '.flaglist' not found Even trying what you suggest and locally calling the flags data within my function, I get: packageVersion("ggflags")
#> [1] '0.0.3'
.flaglist <- utils::data("lflags")
#> Warning in utils::data("lflags"): data set 'lflags' not found
.flaglist <- ggflags::lflags
#> Error: 'lflags' is not an exported object from 'namespace:ggflags' Created on 2023-09-30 with reprex v2.0.2 Can you try loading the flags data without having your package loaded see if it works on your end? Seems like we're going to need another solution to make the function usable through namespacing... 🤔 |
Usually, the way to tackle this, as we discussed previously, is through So I just tried, like this: library(ggflags)
usethis::use_data("flaglist") And it seems to have done something... it created a new dataset called |
Ok I think I found a way to fix it 🤞 Demo still works and R CMD check passes... I realized that when loading the package and then using So what I did is that I created a new object, unhidden, through the old data set, like this (after loading the package): lflags <- .flaglist And this made the
Which created an UNHIDDEN data set called Will try to submit a new PR with the changes... |
It seems like
R CMD check
was never run on this package 💀I've fixed as much as I could. There are still one warning and one note:
Both seem related to documenting the dataset. Although it seems like I did document it, something does not seem to be working correctly. I have tried to use
usethis::use_data()
but this requires either having the original data object in the environment, or to be able to create it from scratch.In theory, having the data object in the environment should be as simple as loading the
lflags.Rda
file. However, opening it for some obscure reason does not load it into the environment, both when double-clicking on the file manually or when using:Created on 2023-09-10 with reprex v2.0.2
I wonder whether the file got corrupted over time or whether it is too old for the current R version. The file was last edited in 2020 by someone else, so that could be it also... Could you try to see if you are able to load the file in your environment at all?
Otherwise I would need to know how to regenerate the file to progress further. Thanks.
Attempts to close #26