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

Added sanitise_dim function for Issue #801 #962

Merged
merged 7 commits into from Jun 18, 2015
Merged

Conversation

@richierocks
Copy link
Contributor

@richierocks richierocks commented May 11, 2014

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)

This comment has been minimized.

@hadley

hadley Jun 11, 2015
Member

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

@@ -0,0 +1,76 @@
test_that(
"sanitise_dim returns NULL for zero-length inputs, with appropriate warnings",

This comment has been minimized.

@hadley

hadley Jun 11, 2015
Member

This seems like way too many unit tests for such a simple function. Could you please simplify focussing on the highest risk areas?

@richierocks
Copy link
Contributor Author

@richierocks richierocks commented Jun 13, 2015

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)

This comment has been minimized.

@hadley

hadley Jun 15, 2015
Member

{ shouldn't be on a new line

@hadley hadley merged commit 406982e into tidyverse:master Jun 18, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hadley
Copy link
Member

@hadley hadley commented Jun 18, 2015

Fixed by hand. Thanks for the patch!

@lock
Copy link

@lock 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants