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>>)
Splus OBJECTS [directory]

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 argument is ignored if frame is given.
frame:
an integer giving the frame number.
pattern:
character pattern that is used by grep to list only a subset of the objects.
directory:
name of a readable directory to search. The default is the first readable and writeable directory named in environment variable S_WORK; this is the same mechanism S-PLUS uses to determine which directory to attach at search position 1, the working directory.

VALUE:
objects returns a character vector of names of the objects in the specified element of the search list or evaluation frame (if frame is given) that match the pattern. By default, all of the objects are listed.

SIDE EFFECTS:
OBJECTS prints these names on the standard output, one per line, for a directory.

DETAILS:
The function objects should be used instead of ls, since it works for all situations: attached data frames, dictionaries, directories, as well as temporary frames, etc.

Since the backslash () is a special character in S-PLUS, if a backslash is used with objects in an 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. The pattern argument to ls used the special filename generation metacharacters of the UNIX Bourne shell.


SEE ALSO:
objects.summary, grep , ls , masked .

EXAMPLES:
# find all the objects starting with "T" in the working directory
  objects(pattern="^T")
[1] "T1"  "TT"
# from the shell, find all objects in my.data.dir
% Splus OBJECTS my.data.dir
# an example of using the backslash with objects in S-PLUS
SP500 <- S.P500 <- 1
objects(pattern = "^S\.")
  [1] "S.P500"