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

Partial argument match of n to na.rm #237

Open
fkohrt opened this issue Jul 8, 2024 · 0 comments
Open

Partial argument match of n to na.rm #237

fkohrt opened this issue Jul 8, 2024 · 0 comments

Comments

@fkohrt
Copy link

fkohrt commented Jul 8, 2024

When running the following code...

withr::with_options(list(
  warnPartialMatchArgs = TRUE, warn = 1
), {
  plt <- faithful |>
    ggplot2::ggplot(ggplot2::aes(x = eruptions)) +
    ggdist::stat_slab(
      density = "histogram"
    )
  print(plt)
})

...R emits the following warnings:

Warning in density(x, n = 2, range_only = TRUE, trim = trim, adjust = adjust,  :
  partial argument match of 'n' to 'na.rm'
Calls: <Anonymous> ... compute_limits_slabinterval -> compute_limits_sample
Warning in match.call(definition, call, expand.dots, envir) :
  partial argument match of 'n' to 'na.rm'
Calls: <Anonymous> ... compute_limits_sample -> density -> structure -> lapply -> match.call
Warning in density(x, n = n, adjust = adjust, trim = trim, breaks = breaks,  :
  partial argument match of 'n' to 'na.rm'
Calls: <Anonymous> ... compute_slab -> compute_slab_slabinterval -> compute_slab_sample
Warning in match.call(definition, call, expand.dots, envir) :
  partial argument match of 'n' to 'na.rm'
Calls: <Anonymous> ... compute_slab_sample -> density -> structure -> lapply -> match.call

It seems like while density_bounded() and density_unbounded() accept n, density_histogram() makes no use of it and somehow it ends up in places where it shouldn't?

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

1 participant