how do i find the 3d indices of where one array is larger than another in r in order to replace these elements with nan?

Use the arr.ind option of which:

which(array2 > array1, arr.ind = TRUE)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top