Skip to content

Commit

Permalink
misc check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Nov 25, 2023
1 parent f4818e3 commit 03f9a2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion R/auto_partial.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,20 @@ auto_partial = function(f, name = NULL) {
lapply(required_arg_names, function(arg_name) expr(missing(!!as.name(arg_name))))
)

partial_self_f = if (identical(environment(f), environment(partial_self))) {
# when auto_partial is called from within the ggdist namespace, don't inline
# the partial self function
quote(partial_self)
} else {
# when auto_partial is called from within the ggdist namespace, we need to
# inline the partial_self function so that it is guaranteed to be found
partial_self
}

new_function(
args,
expr({
if (!!any_required_args_missing) return(partial_self(!!name))
if (!!any_required_args_missing) return((!!partial_self)(!!name))

!!!f_body
}),
Expand Down
2 changes: 1 addition & 1 deletion R/binning_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ find_dotplot_binwidth = function(
stackratio = 1,
layout = c("bin", "weave", "hex", "swarm", "bar")
) {
match.arg(layout)
layout = match.arg(layout)
x = sort(x, na.last = TRUE)

# figure out a reasonable minimum number of bins based on histogram binning
Expand Down

0 comments on commit 03f9a2b

Please sign in to comment.