Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.
You can't use Sample[i (which is just a single scalar) in the "dftr" function (the argument must be a vector or matrix).
You have to use the "submatrix" command!
EDIT: Ah, ttokoro was faster 😉
Here is a suggestion for doing it:
The results are
Note that the range i must run up to rows(Sample)-12 and not up to rows(Sample)-1 as in your attempt.