Bug 16212 - Invisible character in script file but shows in console when run
Summary: Invisible character in script file but shows in console when run
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific (show other bugs)
Version: R 3.1.1
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 minor
Assignee: R-core
Depends on:
Reported: 2015-02-16 04:50 UTC by patrick.coulombe
Modified: 2015-02-16 04:50 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description patrick.coulombe 2015-02-16 04:50:07 UTC
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.