For a given sequence, how can I fetch rows of certain row numbers(indices).
I know that nth()
can select the nth index. But what if I want to select multiple rows by index ?
r.expr([0, 10, 20, 30, 40, 50]).nth(3) // gives 30
The above works. But, how do I get the following ?
r.expr([0, 10, 20, 30, 40, 50]).nth([3, 5, 2]) // gives [30, 50, 20]