The R Project SVN R

Rev

Rev 64657 | Rev 67324 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64657 Rev 67313
Line 1... Line 1...
1
% File src/library/base/man/Syntax.Rd
1
% File src/library/base/man/Syntax.Rd
2
% Part of the R package, http://www.R-project.org
2
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2013 R Core Team
3
% Copyright 1995-2015 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
% = is treated specially in the parser: see PR#14595
6
% = is treated specially in the parser: see PR#14595
7
 
7
 
8
\name{Syntax}
8
\name{Syntax}
Line 61... Line 61...
61
  \code{\link{NumericConstants}}, \code{\link{Paren}},
61
  \code{\link{NumericConstants}}, \code{\link{Paren}},
62
  \code{\link{Quotes}}, \code{\link{Reserved}}.
62
  \code{\link{Quotes}}, \code{\link{Reserved}}.
63
 
63
 
64
  The \sQuote{R Language Definition} manual.
64
  The \sQuote{R Language Definition} manual.
65
}
65
}
-
 
66
\examples{
-
 
67
## Logical AND ("&&") has higher precedence than OR ("||"):
-
 
68
TRUE || TRUE && FALSE   # is the same as
-
 
69
TRUE || (TRUE && FALSE) # and different from
-
 
70
(TRUE || TRUE) && FALSE
-
 
71
 
-
 
72
## Special operators have higher precedence than "!" (logical NOT).
-
 
73
## You can use this for \%in\% :
-
 
74
! 1:10 \%in\% c(2, 3, 5, 7) # same as !(1:10 \%in\% c(2, 3, 5, 7))
-
 
75
## but we strongly advise to use the "!( ... )" form in this case!
-
 
76
 
-
 
77
 
-
 
78
## '=' has lower precedence than '<-' ... so you should not mix them
-
 
79
##     (and '<-' is considered better style anyway):
-
 
80
## Consequently, this gives an error
-
 
81
try( x <- y = 5 ) #->  Error in (x <- y) = 5 : ....
-
 
82
}
66
\keyword{documentation}
83
\keyword{documentation}
67
\keyword{programming}
84
\keyword{programming}