Add utility function for R package
This commit is contained in:
parent
186de413ed
commit
f23ee21ef3
1 changed files with 10 additions and 0 deletions
|
@ -188,4 +188,14 @@ public final class RUtils {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue