Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upadded is* fns #95
Merged
added is* fns #95
Conversation
|
I like the general idea, but I'd prefer it to work like this:
(In retrospect, I should have given the generator object the class I don't think it's necessary to have one function that tests for both. |
R/is.R
Outdated
| #' Checks for R6 class generators and R6 objects. | ||
| #' @param x Any variable. | ||
| #' @return A logical value. | ||
| #' \code{is.r6} returns \code{TRUE} when the input is an R6 class generator or |
wch
Sep 19, 2016
•
Member
I think this would look better with an \itemize list.
I think this would look better with an \itemize list.
R/is.R
Outdated
| #' \code{is.r6obj} returns \code{TRUE} when the input is an R6 object and | ||
| #' \code{FALSE} otherwise. | ||
| #' @examples | ||
| #' class_generator <- R6::R6Class() |
wch
Sep 19, 2016
Member
I'd leave out the R6:: for consistency with other examples.
I'd leave out the R6:: for consistency with other examples.
R/is.R
Outdated
|
|
||
| #' @rdname is.r6 | ||
| #' @export | ||
| is.r6obj <- function(x) |
wch
Sep 19, 2016
Member
I prefer the opening brace to be on the same line as the function(), or for these very simple one-liners, no brace at all.
I prefer the opening brace to be on the same line as the function(), or for these very simple one-liners, no brace at all.
R/is.R
Outdated
| #' is.R6Class(object) | ||
| #' is.R6(object) | ||
| #' @export | ||
| #' @rdname is.r6 |
wch
Sep 20, 2016
Member
I think you can remove this @rdname,
I think you can remove this @rdname,
R/is.R
Outdated
| inherits(x, "R6") | ||
| } | ||
|
|
||
| #' @rdname is.r6 |
wch
Sep 20, 2016
Member
This should be @rdname is.R6.
This should be @rdname is.R6.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
I added
is.r6gento check for R6 class generators,is.r6objto check for R6 objects, andis.r6to check for either of those types.