Add utility function for R package

This commit is contained in:
Joel Therrien 2019-07-24 14:26:08 -07:00
parent 186de413ed
commit f23ee21ef3

View file

@ -188,4 +188,14 @@ public final class RUtils {
return responses; return responses;
} }
public static List<Object> produceSublist(List<Object> initialList, int[] indices){
final List<Object> newList = new ArrayList<>(indices.length);
for(int i : indices){
newList.add(initialList.get(i));
}
return newList;
}
} }