Closed mattwarkentin closed 3 weeks ago
rray has been archived on CRAN, and will eventually require a complete rewrite without xtensor to really be viable in the R community. Unfortunately it will be quite a while before I can get around to that - but i will leave this issue open to consider when I do
I have another thought about another possible (very) minor feature request, I think it would be nice if the axis
argument to rray_flip()
accepted a vector of integers, and all of the flips are applied. Since the order of the flips doesn't affect the result, I think this would be a small change but a welcome one. Currently, if you want to flip along the x
, y
, and z
axis of a 3D array you have to call the function three times over. Not a big deal, of course. The suggested change wouldn't break existing code, but would provide benefits to future code.
library(tidyverse)
library(rray)
a <- array(c(1:24), c(4, 3, 2))
a1 <-
a %>%
rray_flip(1) %>%
rray_flip(2) %>%
rray_flip(3)
a2 <-
a %>%
rray_flip(3) %>%
rray_flip(2) %>%
rray_flip(1)
rray_all_equal(a1, a2)
#> [1] TRUE
Created on 2020-08-18 by the reprex package (v0.3.0)
Hi @DavisVaughan,
Wondering if it would be sensible to slightly extend the functionality of
rray_bind()
such that the.axis
argument can accept values of 0 or negative integers in order to add dimensions to the "front" of the bound array.Here is simple comparison between
rray_bind()
andabind()
. Neither allow the full flexibility of adding dimensions on either side of the array, IMO.rray_bind()
allows adding arbitrary number of dimensions to the "end" of the array, but not before; andabind()
only allows adding a single additional dimension to the beginning or end.Created on 2020-08-12 by the reprex package (v0.3.0)