Find S-PLUS Object Names

DESCRIPTION:

Returns a vector of character strings which are the names of S-PLUS objects in a position on the search list, or in a memory frame.

USAGE:

objects(where=1, frame=NULL, pattern=<<see below>>, 
        regexpr.pattern=<<see below>>, meta, classes, test) 

OPTIONAL ARGUMENTS:

where
an object defining a database in the search list. If where is a number then it implies the corresponding element of the search list. This can also be a character string. This may be a vector of numbers or character strings, to search multiple databases, or "*" to search all databases in the search list. This argument is ignored if frame is given.
frame
an integer giving the frame number.
pattern
character pattern that is used to list only a subset of the objects. This argument is now deprecated in favor of the regexpr.pattern argument.
regexpr.pattern
a character string containing a regular expression (as in the function) used to list only a subset of the objects.
meta
if supplied, for example, as "methods" or "help" (or 1 or 2, respectively), look in the corresponding meta-database instead of the ordinary database. Only meaningful with argument where.
classes
if supplied, the names of one or more classes. Only objects of these classes will be included.
test
if supplied, a function of one argument, intended to be used to select objects. Only the objects for which this function returns TRUE will be included. Including this argument implies reading each object completely (none of the other arguments requires this), so there is some performance penalty.

VALUE:

a character vector of names of the objects in the specified element of the search list (if where is supplied) or evaluation frame (if frame is given). If any of the arguments pattern , classes, or test is supplied, the names are successively restricted by each, applied in that order. For example, if pattern and classes are supplied, the list is reduced by pattern, and then the classes test applied to the reduced list.
If where is vector-valued or "*" , then the result is a list of character vectors, with each database position as an element of the vector.

DETAILS:

Since the backslash (\) is a special character in S-PLUS, if a backslash is used with objects in a S-PLUS expression it must be specified as a double backslash (\\), one for the S-PLUS interpreter and one for objects . See the EXAMPLES section below for more information.

SEE ALSO:

, , , , .

EXAMPLES:

# find all the objects starting with "T" in the working directory 
#  objects(regexpr.pattern="^T") 
[1] "T1"  "TT"  
   
# an example of using the backslash with objects in S-PLUS 
SP500 <- S.P500 <- 1 
objects(regexpr.pattern = "^S\\.") 
  [1] "S.P500"