[Rd] Testing for vectors
becker@g@be @ending from gene@com
Sat Jul 7 20:50:57 CEST 2018
> I was thinking primarily of completing the set of is.matrix() and
> is.array(), or generally, how do you say: is `x` a 1d dimensional
Can you clarify what you mean by dimensionality sense and specifically 1d
You can have a 1d array which is different from what your proposed function
would call a vector. So is.null(dim(x)) doesn't seem the same as 1d, right?
> x = array(1:10)
 1 2 3 4 5 6 7 8 9 10
You can also have an n x 1 matrix, which *technically* has 2 dimensions but
conceptually is equivalent to a 1d array and/or a vector.
Also, are you including lists in your conceptions of 1d vector here? I'm
with Duncan here, in that i'm having trouble understanding exactly what you
want to do without a bit more context.
> (I don't have any feel for whether the check should be is.null(dim(x))
> vs. length(dim(x)) <= 1)
> R-devel using r-project.org mailing list
Gabriel Becker, Ph.D
Bioinformatics and Computational Biology
[[alternative HTML version deleted]]
More information about the R-devel