.BG
.VE $Header: /usr3/s/current/s/.help/RCS/prefix,v 1.2 83/12/30 19:32:38 rab Exp $
.FN prefix
.TL
prefix: Set Prefix for Dataset Names
.CS
prefix(name)
.PP
.AG name
character string, consisting of characters which are legal for
dataset names, i.e., letters, digits and ".".  The
function then has the side effect that this string is
automatically prepended to all dataset names used in
subsequent expressions.  The prefix may be overridden by
giving a fully-qualified dataset name and starting the name
with "$".  If the argument is omitted, the prefix is made
empty (also the initial state).
.RT
the previous prefix, so that one can store and restore the
prefix (useful in macros).  The result of `prefix' is not
automatically printed.
.PP
It is recommended that `prefix' be used to distinguish datasets
generated during a particular analysis.  Thus, for example, if we want
to analyze some data concerning wages, the prefix may be set to
"wages." with the result that commonly used names, such as "x", "y",
"label", etc. do not conflict with datasets of the same name, used in
analysis of other data.
.PP
Slashes may also be used in prefixes
(and in dataset names given in character
form to the `get' or `assign' functions),
to specify subdirectories under the directory containing the data.
The construction of subdirectories corresponding to prefixes is
sometimes a good idea, as it avoids the UNIX restriction of dataset
names to 14 characters.
However, the subdirectory must be created (by the system command mkdir)
before datasets can be stored there.
.SH BUGS
The `ls' function does not work for subdirectories, and it is difficult
to refer to datasets inside subdirectories without using `prefix'.
.EX
oldp<-prefix("wages.") #set prefix, store old one
print(x,y,$z) #print wages.x wages.y and z
print( prefix( ) ) #delete prefix and print its previous value

!mkdir swork/abc
prefix("abc/")
x <- 1:10      # creates dataset abc/x
prefix( )   # turn off prefix
abc/x      # this means abc divided by x
get("abc/x")  # this reads the dataset
.KW basic*
.KW data management
.WR
