[R] rbenchmark: why is function benchmark back-quoted?
Yihui Xie
xie at yihui.name
Tue Oct 8 18:29:47 CEST 2013
I think there are two possibilities: (1) package.skeleton() can
produce this; (2) the package author prefers this style. Back-quoting
is often unnecessary, unless the object name is not valid without
back-quoting, e.g.,
> `a b` <- 1:2
> ls()
[1] "a b"
> a b
Error: unexpected symbol in "a b"
> `a b`
[1] 1 2
> %in%
Error: unexpected SPECIAL in "%in%"
> `%in%`
function (x, table)
match(x, table, nomatch = 0L) > 0L
<environment: namespace:base>
Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Tue, Oct 8, 2013 at 10:36 AM, Prof J C Nash (U30A) <nashjc at uottawa.ca> wrote:
> The function 'benchmark' which is the only one in package 'rbenchmark' has a
> back-quoted name in its first line
>
> `benchmark` <- function( ....
>
> I wondered whether this had specific importance. It appears not.
>
> JN
>
>
>
> On 13-10-08 11:15 AM, Jeff Newmiller wrote:
>>
>> Your use of the English language is failing to communicate. You mention
>> "the name" when "name" is not a proper noun. Are you referring to some
>> specific example?
>>
>> ---------------------------------------------------------------------------
>> Jeff Newmiller The ..... ..... Go
>> Live...
>> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
>> Go...
>> Live: OO#.. Dead: OO#.. Playing
>> Research Engineer (Solar/Batteries O.O#. #.O#. with
>> /Software/Embedded Controllers) .OO#. .OO#.
>> rocks...1k
>>
>> ---------------------------------------------------------------------------
>> Sent from my phone. Please excuse my brevity.
>>
>> "Prof J C Nash (U30A)" <nashjc at uottawa.ca> wrote:
>>>
>>> I'm wondering what the purpose of the back-quoting of the name is,
>>> since
>>> benchmark seems a valid name. The language reference does mention
>>> back-quoting names to make them syntactic names, but I found no
>>> explanation of the "why".
>>>
>>> Can someone give a concise reason?
>>>
>>> JN
More information about the R-help
mailing list