Loop in r with subset makes incomplete selection
I have a data frame (words) containing words with five letters, in which each letter appears in one of five columns. The sixth column represents the log probability of the word based on letter frequency.
v1 v2 v3 v4 v5 ln_freq
1 s e i n e -10.54397
2 s o u s e -10.74434
3 s o u s e -10.74434
4 c r a n e -10.75617
5 s h a r e -10.80898
R: How to run ‘for-loop’ by factor level?
How does one do ‘for-loops’ with different variable types? My loop works by simply averaging counts, then increases the sample size as more data gets added; except it doesn’t repeat the sequence of steps for each factor level (only 1 of 2). What do I need to add to change that?