.BG
.VE $Header: /usr3/s/current/s/.help/RCS/assign,v 1.2 83/12/30 19:24:19 rab Exp $
.FN assign
.FN _
.FN ->
.FN <-
.TL
<-    ->    _   assign: Assignment
.CS
name <- expression
name _  expression
expression -> name
.PP
The assignment operator, in any of its forms, causes the value of
`expression' to be saved on the working storage file under `name'.  Note
that the arrow always points toward `name'.  The left-arrow is made up
of the two characters less-than and minus.  An underscore can also be
used for left-arrow.  Right-arrow is the two characters minus greater-than.
.PP
Once an assignment is made, the data can be retrieved by mentioning
the name used in the assignment.  The value of the assignment (when
used as an expression) is the `expression' part of the assignment.
Missing values (NAs) are allowed in `expression'.
.PP
Assignment can also be done with the function `assign'.
.CS
assign(cname, expression, pos=)
.PP
.AG cname
character string giving the name of a dataset to create.
.AG pos=
the position in the current search list of the data directory on
which `expression' is to be stored. Default 1.
See `attach' and `save'.
`save' is the usual way to assign, other than to the working
data.
.EX
y <- sqrt( x<-runif(100) )      # 100 uniforms saved as x
          # square root of sample saved under the name y

assign("x", runif(100))     # equivalent to x <- runif(100)

for(i in seq(ncol(x)))
     assign(colname[i],x[,i])
     # saves each column of matrix x under different name
.KW basic*
.KW builtin
.KW data management
.KW manip
.WR
