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

ppml: additional_regressors is not really NULL by default? #23

Open
MatthieuStigler opened this issue Nov 21, 2024 · 1 comment
Open

Comments

@MatthieuStigler
Copy link

According to ?ppml,

additional_regressors: By default this is set to NULL.

But it seems by default it is missing, not NULL? See below.

Also, I would suggest removing the dependence on dplyr for this specific example, as subset() does the same here?

library(gravity)
#> Gravity 1.1
#> If this package is useful, please support it. https://www.buymeacoffee.com/pacha.
#> 
#> Attaching package: 'gravity'
#> The following object is masked from 'package:stats':
#> 
#>     nls
data("gravity_no_zeros")

# Choose 5 countries for testing
countries_chosen <- c("AUS", "CHN", "GBR", "BRA", "CAN")
grav_small <- subset(gravity_no_zeros, iso_o %in% countries_chosen)

fit <- ppml(
  dependent_variable = "flow",
  distance = "distw",
  data = grav_small
)
#> Error in ppml(dependent_variable = "flow", distance = "distw", data = grav_small): argument "additional_regressors" is missing, with no default

Created on 2024-11-21 with reprex v2.1.1

@pachadotdev
Copy link
Owner

According to ?ppml,

additional_regressors: By default this is set to NULL.

But it seems by default it is missing, not NULL? See below.

Also, I would suggest removing the dependence on dplyr for this specific example, as subset() does the same here?

library(gravity)
#> Gravity 1.1
#> If this package is useful, please support it. https://www.buymeacoffee.com/pacha.
#> 
#> Attaching package: 'gravity'
#> The following object is masked from 'package:stats':
#> 
#>     nls
data("gravity_no_zeros")

# Choose 5 countries for testing
countries_chosen <- c("AUS", "CHN", "GBR", "BRA", "CAN")
grav_small <- subset(gravity_no_zeros, iso_o %in% countries_chosen)

fit <- ppml(
  dependent_variable = "flow",
  distance = "distw",
  data = grav_small
)
#> Error in ppml(dependent_variable = "flow", distance = "distw", data = grav_small): argument "additional_regressors" is missing, with no default

Created on 2024-11-21 with reprex v2.1.1

good catch!!
that must have sneaked in rushing something for cran changes

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