How do I calculate the average number of words in a list using for loop in r? I have a list called mylist
which contains 25 vectors with character quotes on each vector.
Here is my code so far:
count <- 0
for (i in mylist[1:25]){
count <- count + i
mean(count)
}
But I get this error :
Error in count + i : non-numeric argument to binary operator
Any help will be greatly appreciated!