From Friedrich.Leisch@ci.tuwien.ac.at  Thu Apr 27 15:09:00 2000
From: Friedrich.Leisch@ci.tuwien.ac.at (Friedrich Leisch)
Date: Thu, 27 Apr 2000 16:09:00 +0200 (CEST)
Subject: [Rd] Re: [R] Writing lgrindefs
In-Reply-To: <Pine.OSF.4.05.10004271508590.9815-100000@alnair.uio.no>
References: <3907EA6D.6BE703BF@statistik.uni-dortmund.de>
 <Pine.OSF.4.05.10004271508590.9815-100000@alnair.uio.no>
Message-ID: <14600.18940.551062.659955@galadriel.ci.tuwien.ac.at>

>>>>> On Thu, 27 Apr 2000 15:16:10 +0200 (MET DST),
>>>>> Kjetil Kjernsmo (KK) wrote:

KK> On Thu, 27 Apr 2000, Uwe Ligges wrote:
>>> however, having all the functions defined in base highlighted as keywords.
>>> Would that be a good idea, and if it is, how can I extract the function
>>> names most easily?
>> 
>> 1. You get a list of objects (not only functions!!!) by typing
>> ls(env=environment("R_GlobalEnv"))
>> 
>> 2. In the html-help files, e.g. the "Functions" index could help you.
>> Attention: Not only functions are listed here!


Finding out what is a function and what not is easy:

R> x<- ls("package:base")
R> x[40]
[1] ".lib.loc"
R> x[140]
[1] "anovalist.lm"

where the first is a vector and the second a function, which can
easily be traced:

R> sapply(x[c(40,140)],function(y){is.function(get(y))})
    .lib.loc anovalist.lm 
       FALSE         TRUE 

(don't know if this is the most elegant way of doing it). This leaves
all operators in the list as they are only functions allowing a
special syntax, hence if you want only ordinary functions, you could
simply discard those not starting with a dot or a letter.

Hope this helps,
Fritz

-- 
-------------------------------------------------------------------
                        Friedrich  Leisch 
Institut fr Statistik                     Tel: (+43 1) 58801 10715
Technische Universitt Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstrae 8-10/1071      Friedrich.Leisch@ci.tuwien.ac.at
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
     PGP public key http://www.ci.tuwien.ac.at/~leisch/pgp.key
-------------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Re: [R] Writing lgrindefs
Friedrich Leisch