I have a vector [[[1 2] [3 4]] [[5 6] [7 8]] [9 10] 11] . I want to apply a function to this vector, but keep the data structure.
For example, I want to add 1 to each number, but save the data structure to get the result [[[2 3] [4 5]] [[6 7] [8 9]] [10 11] 12] . Is it possible?
I tried
(map
But you can see that the data structure is not the same.
Perhaps there is a function that takes from (2 3 4 5 6 7 8 9 10 11 12) to [[[2 3] [4 5]] [[6 7] [8 9]] [10 11] 12]
I thought it might be possible to use postwalk, but I'm not sure if this is correct.
Any help would be greatly appreciated
source share