Re: [R] questions on some operators in R

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Wed, 16 Jun 2010 18:55:12 -0400

On Jun 16, 2010, at 6:33 PM, li li wrote:

> Hi all,
> I have two questions. Can some one give some help?
>
> The first question is regarding the pair of operators "&" and
> "&&". What
> is the
> difference between the two?

& operates on vectors, returns a vector

&& operates on the first item in each argument. Retruns a value and a warning if either of the arguments of of length > 1.

>
> The second question is regarding "<-" and "=". Usually we use
> "<-" as the assignment operator. I saw some people use "=". Is there
> any difference between the two.
>
Yes. Many discussions in the archives. will be more erudite and accurate than mine. "=" is preferred for assigning values in argument lists. "<-" is preferred for assignment to objects. Generally the differences do not matter but there are exceptions.

-- 
David.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 16 Jun 2010 - 22:58:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jun 2010 - 23:00:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive