Remove redundant operations such as `which`
In the code we have seen redundant operations using the R function which
. Such operation is expensive, therefore, it should be only computed once.
In the code we have seen redundant operations using the R function which
. Such operation is expensive, therefore, it should be only computed once.