Menu

#1 Patch for a bug in .rgedit.lastline2clipboard()

open
nobody
None
5
2013-04-01
2013-04-01
No

When any of xclip, xsel or pbcopy are missing the line #39 in .rgedit.lastline2clipboard() throws an R error. Since the default values of available.clipboard.commands are already at FALSE the simplest way to solve this bug is to enclose the offending line in a try() block so that the value is changed to TRUE only if the command succeeds:

try({
available.clipboard.commands[i] <- length(system( paste( "command -v ", names(available.clipboard.commands)[i], sep=""), intern=TRUE )) > 0;
}, silent=TRUE);

Discussion