Array selection & selective assignment
Posted: January 15th, 2012, 8:50 am
given an array of rank 2 or above, I'd like to be able to do
1. return the elements where the condition is true as a vector e.g.
array[array >10]
2. selectively reassign those elements
array[array >10] <- 0
I know that both are achievable with a slight rearrangement of the syntax but what I propose is an intuitive extension.
1. return the elements where the condition is true as a vector e.g.
array[array >10]
2. selectively reassign those elements
array[array >10] <- 0
I know that both are achievable with a slight rearrangement of the syntax but what I propose is an intuitive extension.