The R Project SVN R

Rev

Rev 64657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64657 Rev 74873
Line 1... Line 1...
1
#  Copyright (C) 1997-2013 The R Core Team
1
#  Copyright (C) 1997-2018 The R Core Team
2
 
2
 
-
 
3
### The Base package has a couple of non-functions:
-
 
4
##
3
## being a 'builtin' function is not the same as being in base
5
## These may be in "base" when they exist;  discount them here
-
 
6
## (see also  'dont.mind' in checkConflicts() inside library()) :
-
 
7
xtraBaseNms <- c("last.dump", "last.warning", ".Last.value",
-
 
8
                 ".Random.seed", ".Traceback")
-
 
9
ls.base <- Filter(function(nm) is.na(match(nm, xtraBaseNms)),
4
ls.base <- ls("package:base", all=TRUE)
10
                  ls("package:base", all=TRUE))
5
base.is.f <- sapply(ls.base, function(x) is.function(get(x)))
11
base.is.f <- sapply(ls.base, function(x) is.function(get(x)))
6
cat("\nNumber of base objects:\t\t", length(ls.base),
12
cat("\nNumber of all base objects:\t", length(ls.base),
7
    "\nNumber of functions in base:\t", sum(base.is.f),
13
    "\nNumber of functions from these:\t", sum(base.is.f),
8
    "\n\t starting with 'is.' :\t  ",
14
    "\n\t starting with 'is.' :\t  ",
9
    sum(grepl("^is\\.", ls.base[base.is.f])), "\n", sep = "")
15
    sum(grepl("^is\\.", ls.base[base.is.f])), "\n", sep = "")
-
 
16
## R ver.| #{is*()}
-
 
17
## ------+---------
10
## 0.14  : 31
18
## 0.14  : 31
11
## 0.50  : 33
19
## 0.50  : 33
12
## 0.60  : 34
20
## 0.60  : 34
13
## 0.63  : 37
21
## 0.63  : 37
14
## 1.0.0 : 38
22
## 1.0.0 : 38
15
## 1.3.0 : 41
23
## 1.3.0 : 41
16
## 1.6.0 : 45
24
## 1.6.0 : 45
17
## 2.0.0 : 45
25
## 2.0.0 : 45
-
 
26
## 2.7.0 : 48
-
 
27
## 3.0.0 : 49
-
 
28
if(interactive()) {
-
 
29
    nonDots <- function(nm) substr(nm, 1L, 1L) != "."
-
 
30
    cat("Base non-functions not starting with \".\":\n")
-
 
31
    Filter(nonDots, ls.base[!base.is.f])
-
 
32
}
18
 
33
 
19
## Do we have a method (probably)?
34
## Do we have a method (probably)?
20
is.method <- function(fname) {
35
is.method <- function(fname) {
21
    isFun <- function(name) (exists(name, mode="function") &&
36
    isFun <- function(name) (exists(name, mode="function") &&
22
                             is.na(match(name, c("is", "as"))))
37
                             is.na(match(name, c("is", "as"))))