Dear Rcppusers, I can't figure out what the following codes do: int f4(Function pred, List x) { int n = x.size(); for(int i = 0; i < n; ++i) { LogicalVector res = pred(x[i]); if (res[0]) return i + 1; } return 0; } I investigated it, and understand applying a function to everypart of a list then return a LogicalVector, but i can't understand if the first element of the LogicalVector is true then return the row index of the list. Tks! -- PO SU mail: desolator88@163.com Majored in Statistics from SJTU [[alternative HTML version deleted]]