Skip to content

Error on inconsistent object dimensions #3

@MetaEntropy

Description

@MetaEntropy

Currently, 'test', 'yes' and 'no' can have inconsistent dimensions without any warning or error even with strict=TRUE

> test=rbind(alpha=c(A=TRUE, B=FALSE),beta=c(FALSE, TRUE))
> yes=matrix(nrow=1, ncol=4, 1:4)
> no=matrix(nrow=4, ncol=1, 1:4*10)
> ifelse1(test, yes, no)
       A  B
alpha  1 30
beta  20  4
> ifelse1(test, yes, no, strict=TRUE)
       A  B
alpha  1 30
beta  20  4
> yes+no
Error in yes + no : non-conformable arrays

I would expect an error (or at least a warning) by default on the ifelse1() operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions