Skip to content

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

Merged
merged 7 commits into from
Jun 18, 2015

Conversation

richierocks
Copy link
Contributor

As discussed in issue #801, facet_wrap doesn't properly check the nrow and ncol arguments, particularly negative values.

I've added a sanitise_dim function (plus some tests) to deal with this.

#' sanitise_dim(0)
#' sanitise_dim("foo")
#' }
sanitise_dim <- function(n)
Copy link
Member

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

@richierocks
Copy link
Contributor Author

sanitise_dim roxygen comments are now @nord, I've removed half the unit tests, and both the code and tests are now in the house style.

sanitise_dim <- function(n)
{
xname <- sQuote(deparse(substitute(n)))
if (length(n) == 0)
Copy link
Member

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

@hadley hadley merged commit 406982e into tidyverse:master Jun 18, 2015
@hadley
Copy link
Member

hadley commented Jun 18, 2015

Fixed by hand. Thanks for the patch!

@lock
Copy link

lock bot commented Jan 19, 2019

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/

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants