From mick.jordan at oracle.com  Wed Jul  8 00:33:24 2015
From: mick.jordan at oracle.com (Mick Jordan)
Date: Tue, 07 Jul 2015 15:33:24 -0700
Subject: [Rd] [ on call
Message-ID: <559C53B4.2060804@oracle.com>

I'm rather puzzled by this behavior:

e
export("caption<-", "caption", "label", "label<-", "align<-",
     "align", "digits<-", "digits", "display<-", "display", "xtable",
     "print.xtable", "toLatex.xtable")
 > e[[1L]]
e[[1L]]
export
 > e[-1L]
e[-1L]
"caption<-"("caption", "label", "label<-", "align<-", "align",
     "digits<-", "digits", "display<-", "display", "xtable", 
"print.xtable",
     "toLatex.xtable")

I'm not at all clear what should result from removing the first element, 
i.e. the 'export', but I would not expect the first argument to be 
promoted into the function position. I guess I would expect a coercion 
to list or pairlist first, after which the [-1L] would produce a 
meaningful result on that coercion. In any event I do observe that 
as.character(e[-1L]) produces the expected result:

as.character(e[-1L])
  [1] "caption<-"      "caption"        "label" "label<-"
  [5] "align<-"        "align"          "digits<-" "digits"
  [9] "display<-"      "display"        "xtable" "print.xtable"
[13] "toLatex.xtable"

This code is from parseNamespaceFile (on the xtable package).

Mick Jordan



[Rd] [ on call
Mick Jordan