An example of the former would be:
An example of the latter would be:
Now, in a loop that goes through the cases, it needs to work with a (smaller) matrix that concerns that case only. Therefore, with the former approach we would slice the matrix (via logical or a find) while in the latter we would just call allcases(case_id).matrix.
Is there a recommended approach between these two, in terms of computational speed?
In my problem, I work with up to 100 cases, and up to 50,000 rows in the matrix containing data for each case.