-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added sanitise_dim function for Issue #801 #962
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
Conversation
#' sanitise_dim(0) | ||
#' sanitise_dim("foo") | ||
#' } | ||
sanitise_dim <- function(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use house style, e.g. http://r-pkgs.had.co.nz/r.html#style ?
I'd also rather not export this function, so either delete the roxygen comments or add @noRd
|
sanitise_dim <- function(n) | ||
{ | ||
xname <- sQuote(deparse(substitute(n))) | ||
if (length(n) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
shouldn't be on a new line
Fixed by hand. Thanks for the patch! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
As discussed in issue #801,
facet_wrap
doesn't properly check thenrow
andncol
arguments, particularly negative values.I've added a
sanitise_dim
function (plus some tests) to deal with this.