[R] '=' vs '<-'

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Nov 3 19:37:30 CET 2010


On Wed, Nov 3, 2010 at 6:04 PM, km <srikrishnamohan at gmail.com> wrote:
> Hi all,
>
> can we use '=' instead of '<-' operator for assignment in R programs?

 Yes, mostly, you can also use 'help' to ask such questions:

 > help("=")

    The operators ‘<-’ and ‘=’ assign into the environment in which
     they are evaluated.  The operator ‘<-’ can be used anywhere,
     whereas the operator ‘=’ is only allowed at the top level (e.g.,
     in the complete expression typed at the command prompt) or as one
     of the subexpressions in a braced list of expressions.

and so on...



More information about the R-help mailing list