[R-SIG-Mac] Open parenthesis immediately returns error

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jul 13 18:50:05 CEST 2009

On 7/13/2009 12:35 PM, Garrett Grolemund wrote:
> Whenever I type a parenthesis immediately following a word (as if I'm
> entering a function) R displays the following error
> Error in try(gsub("\\s+", " ", paste(capture.output(print(args(try))),  :
>   unused argument(s) (silent = TRUE)
>> try(
> The above is pasted from my R console. The error appears above the command
> because it appears immediately upon typing the parenthesis.  It does not
> wait until I try to execute the command.  This happens for every function.
> I can finish typing the function and execute it.  But these error messages
> make it difficult to debug my code.  In particular, if I have options(error
> = recover) set, the above crashes R.
> I can avoid the error by typing the parentheses first and then moving the
> cursor back to type in the word. This error displays on the console whether
> I'm typing in the console or in an open document window.
> I'm using the mac GUI for R.  The error only occurs on my Macbook (OS X
> 10.5.7), which I bought a few months ago.  It has occurred  every time I use
> R on this computer.  It has happened with R 2.8 and now R 2.91.
> Any idea what may be going on?

Presumably this has something to do with command completion or argument 
hints.  From the "silent = TRUE" error, and your example, I would guess 
you have a function named try(), and the GUI is finding yours instead of 
the one in the base package.

The GUI shouldn't do that, it should look in the right place, but as a 
workaround, you could remove your function named "try", and call it 
something else.

Duncan Murdoch

More information about the R-SIG-Mac mailing list