I want to apply a for loop on a non-specified range of rows in a tibble.
I have to modify the following code that applies a for loop on a specific number of rows in a tibble:
for(times in unique(dat$wname)[1:111]){...}
In this tibble the range from 1:111 corresponds to a specific file, in fact, the value of the column "File" repeat 111 times. However, in my data, I do not know how many times the same file repeat. For example, I can have a file that repeats for 80 rows and another for 85. How do I tell the loop to look only in the range in which the rows in the column file have the same name?
I need something to say:
for(times in unique(dat$wname)["for each row in the column File with the same name"]){...}
How can I do it?