The R Project SVN R

Rev

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

Rev 60551 Rev 61150
Line 49... Line 49...
49
 
49
 
50
  If \code{mode} is specified then only objects of that type are sought.
50
  If \code{mode} is specified then only objects of that type are sought.
51
  The \code{mode} may specify one of the collections \code{"numeric"} and
51
  The \code{mode} may specify one of the collections \code{"numeric"} and
52
  \code{"function"} (see \code{\link{mode}}): any member of the
52
  \code{"function"} (see \code{\link{mode}}): any member of the
53
  collection will suffice.  (This is true even if a member of a
53
  collection will suffice.  (This is true even if a member of a
54
  collection is specified, so for example \code{mode="special"} will
54
  collection is specified, so for example \code{mode = "special"} will
55
  seek any type of function.)
55
  seek any type of function.)
56
}
56
}
57
\value{
57
\value{
58
  Logical, true if and only if an object of the correct name and mode is
58
  Logical, true if and only if an object of the correct name and mode is
59
  found.
59
  found.
Line 70... Line 70...
70
  and for yet a different kind, namely if a file exists,
70
  and for yet a different kind, namely if a file exists,
71
  \code{\link{file.exists}}.
71
  \code{\link{file.exists}}.
72
}
72
}
73
\examples{
73
\examples{
74
##  Define a substitute function if necessary:
74
##  Define a substitute function if necessary:
75
if(!exists("some.fun", mode="function"))
75
if(!exists("some.fun", mode = "function"))
76
  some.fun <- function(x) { cat("some.fun(x)\n"); x }
76
  some.fun <- function(x) { cat("some.fun(x)\n"); x }
77
search()
77
search()
78
exists("ls", 2) # true even though ls is in pos=3
78
exists("ls", 2) # true even though ls is in pos = 3
79
exists("ls", 2, inherits = FALSE) # false
79
exists("ls", 2, inherits = FALSE) # false
80
}
80
}
81
\keyword{data}
81
\keyword{data}