haziqj / iprior

An R package for I-prior regression
GNU General Public License v3.0
1 stars 1 forks source link

Code cleanup in `indxFn()` #30

Closed haziqj closed 7 years ago

haziqj commented 7 years ago

Not so much as an issue, but code that could be cleaned up. Replace the use of

zb <- which((ind1 %in% grid.PR[,1] & ind2 %in% grid.PR[,2]) | 
            (ind2 %in% grid.PR[,1] & ind1 %in% grid.PR[,2]))

with the already written helper function findH2()

zb <- apply(grid.PR, 1, findH2, ind1 = ind1, ind2 = ind2)