.BG
.FN ls
.TL
List of Datasets in Data Directory
.CS
ls(pattern, pos=1)
.AG pattern
an optional character string describing the object names
of interest.
The syntax for `pattern' is that of the `ls' shell command.
For example, `ls("abc")' matches
the name of the object `abc'.  The
character "*" occurring in `pattern' matches any number (including zero)
of characters.  `ls("abc*")' returns the
names of any objects whose names began with `abc'.  The
default pattern is "*", which matches all object names.
The character "?" occurring in `pattern' matches any single character.
A pattern consisting of
characters between square brackets matches any one of the enclosed
characters;  a pair of characters separated by a "\-" matches any character
between the pair, in the
.Sc ASCII
ordering of characters.
.AG pos
the position on the data directory search list of the data directory to
be searched.  Position 1 is the working directory.
Normally, positions 2 and 3 are the function and system data directories.
Position 0 refers to assignments to the session frame (see `assign').
.RT
a character vector containing the names of the
objects that match the pattern on the specified data directory.
.EX
ls()     #list all working object names
ls("lottery*",pos=3)   #system database names
	# beginning in "lottery"
ls("???")  # 3-character object names
ls("[A-Z]*")  # starts with upper case letter
ls(".*")    # starts with "."
.KW data
.WR
