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

undefined global functions or variables #62

Open
ajpelu opened this issue Sep 7, 2024 · 4 comments
Open

undefined global functions or variables #62

ajpelu opened this issue Sep 7, 2024 · 4 comments
Assignees

Comments

@ajpelu
Copy link
Collaborator

ajpelu commented Sep 7, 2024

After try to check the pkg, there are a lots of NOTES related to undefined global functions or variables. Specifically I got:

Undefined global functions or variables:
    AIC BIC aic available_models bootstrap coef coefs country_names
    curvetype development_rate filter formula is iter model_AIC model_fit
    model_name mutate n_params na.exclude param_est pred pred_devrate
    preds reformulate source_model_name start_value temp temperature
    tibble working_formula

I was sailing in the web and found this that points a possible solution by creating a global_variables.R

utils::globalVariables(c("prob", "section", "y")) # or whatever of our variables not defined

@dario-ssm @Pakillo @AMBarbosa have you address this problem previously?

@ajpelu
Copy link
Collaborator Author

ajpelu commented Sep 7, 2024

I think another possible solution would be to add

var <- var2 <- NULL 

in each of the function containing this kind of variables not defined. For instance in fit_devmodels function the solution is add

n_params <- AIC <- BIC <- NULL

in the first lines of the function

I have tried and it works. Please revise the corresponding functions.

I've worked on the main branch, and also push on it.

@Pakillo
Copy link
Member

Pakillo commented Sep 9, 2024

Thanks Antonio

Yes, we haven't paid much attention to CMD CHECK yet, as we were still changing and revising functions. IMO the best way to fix the "undefined global variables" is using utils::globalVariables. But as functions are still changing, the global variables may change too, so I think we can do that once all functions are more or less settled

@ajpelu
Copy link
Collaborator Author

ajpelu commented Sep 9, 2024

Ok, I agree with you. We can use utils::globalVariables.
@dario-ssm could you do once each function is stable?

@dario-ssm
Copy link
Collaborator

Thanks Antonio, I will write them once all functions are definitive and testing are passing fine for all of them.

@dario-ssm dario-ssm self-assigned this Sep 10, 2024
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

3 participants