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

all.equal.recmap : (target, current) -> {TRUE, FALSE} / if is not TRUE, then a string is returned #11

Closed
cpanse opened this issue May 25, 2018 · 1 comment
Assignees
Labels
bug

Comments

@cpanse
Copy link
Owner

@cpanse cpanse commented May 25, 2018

recmap:::all.equal.recmap
function (target, current, ...)
{
     all.equal(target$x, current$x) & all.equal(target$y, current$y) &
         all.equal(target$dx, current$dx) & all.equal(target$dy,
         current$dy) & all.equal(target$z, current$z) &
all.equal(target$name,
         current$name)
}

if all.equal(target$x, current$x) is not TRUE, then a string is
returned indicating what the difference is. This precludes the
combination with & and leads to when this function is called and objects
are not equal:

Error in all.equal(target$x, current$x) & all.equal(target$y, current$y) :
operations are possible only for numeric, logical or complex types

At least the use of isTRUE() should be considered to ensure that
scalar logicals are combined with &.

thanks to Bettina Gruen

@cpanse cpanse self-assigned this May 25, 2018
@cpanse cpanse added the bug label May 25, 2018
@cpanse cpanse changed the title bug: all.equal.recmap : (target, current) -> {TRUE, FALSE} / if is not TRUE, then a string is returned all.equal.recmap : (target, current) -> {TRUE, FALSE} / if is not TRUE, then a string is returned May 25, 2018
@cpanse
Copy link
Owner Author

@cpanse cpanse commented May 27, 2018

all.equal.recmap <- function(target, current, ...){
  isTRUE(all.equal(target$x, current$x, ...)) &
  isTRUE(all.equal(target$y, current$y, ...)) &
  isTRUE(all.equal(target$dx, current$dx, ...)) & 
  isTRUE(all.equal(target$dy, current$dy, ...)) &
  isTRUE(all.equal(target$z, current$z, ...)) &
  isTRUE(all.equal(target$name, current$name, ...))
}

commit e98cee0

@cpanse cpanse closed this May 27, 2018
cpanse added a commit that referenced this issue May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.