I was trying to run a line from a script file that read:
"t.health.bysex <- tapply(d$health_r, INDEX=list(d$year, d$sex), FUN=mean)"
However, the resulting output in the console was an error:
"Error in t.health. - bysex <- tapply(d$health_r, INDEX = list(d$year, :
object 't.health.' not found"
I could not find the error in the script file. However, I put my cursor after the "b" in "t.health.bysex", then I hit the left arrow on my keyboard, which brought the cursor before the "b", after the second period; THEN, I hit the left arrow again, but the cursor did not move and stayed after the period (!). I hit the left arrow again, and only then was the cursor before the period, as if there had been a character between the second period and the "b" (a dash I assume). When I erased the whole name from the script file and simply rewrote it, the problem was gone (even though the syntax file looked, of course, the same as before).
This had never happened to me before.
One seemingly important thing to note: I use a mechanical keyboard, which has N-key rollover, meaning that there are as many key presses registered as I press keys, even if the presses are simultaneous. So one guess is that I pressed two keys simultaneously (. and -, or - and b), the OS registered both, but R did not successfully handle two simultaneous (or perhaps near simultaneous) presses.
I use R 3.1.1 64-bit and Windows 8.1 64-bit.