I am counting the sum of words of strings with specific arguments e.g. for weeks (week 1 = 1, week 2 = 2 and so on) with the following command:
sum(data[which(data[,17]==1), 19])
[,17] is the column in the data frame of the numeric argument of the week which has to be 1 for week 1
, 19 is the column in the data frame of the number of words of each string
I have 31 weeks and 228.000 strings and I do not want to execute each command for each week seperately so I am searching for a function which can do it automatically for week 1-31 and gives me the results.
Thanks for helping!