Open DavisVaughan opened 5 years ago
This is sort of related to advanced indexing in numpy, I think
Actually I think this is dimensionality stable. All that means is that you must be able to predict the dimensionality of the output from the type of the input (vctrs type). The type includes the 2nd+ dimensions, but not the size.
So:
<array[,2]>[<integer>, ]
should always return the same thing, whether <integer>
is length 1 or 2 (base R does not), but <array[,2]>[<integer[,2]>,]
would be allowed to return something different, because the indexer has a different type
Note) This would make
[
dimensionality-unstable, but it would always be dimensionality stable when using vectors, and would only actually allow the dimensionality to increase, never decrease.Julia has a neat subsetting syntax that would let you do:
Created on 2019-04-17 by the reprex package (v0.2.1.9000)
Its like a subset + reshape in one go