See help(Arithmetic)
[1] 10
[1] 3
[1] 159
[1] 3
[1] 1
Also see help(Syntax)
for operator precendence / associativity: This determines the order in which computations are carried out when multiple operators are present. Use parentheses to make execution order explicit.
[1] 45
[1] 29
Using operators in function notation
[1] 0.1
[1] 5
[1] 2
[1] 1
[1] 4
[1] 2
[1] 2.718282
[1] 1
[1] 3.142
[1] 2
[1] 3
[1] 22
[1] -1+0i
[1] 0+0i
[1] NaN
[1] 0+1i
[1] 2147483647
[1] 2.220446e-16
[1] Inf
[1] TRUE
[1] NaN
[1] TRUE
NULL
[1] TRUE
[1] 4
[1] 93
[1] TRUE
[1] FALSE
[1] FALSE
[1] TRUE
[1] TRUE
[1] FALSE
[1] TRUE
[1] FALSE
[1] FALSE
[1] TRUE
[1] TRUE
[1] FALSE
[1] FALSE
[1] FALSE
[1] TRUE
[1] TRUE
[1] FALSE
[1] TRUE
[1] TRUE
[1] FALSE
Short-circuit logical comparisons with vectors
[1] TRUE
[1] FALSE
[1] TRUE
[1] FALSE
[1] FALSE
[1] TRUE
TRUE
[1] FALSE
[1] TRUE
[1] FALSE
[1] TRUE
In an empty vector, there is no element that is FALSE
, therefore:
[1] TRUE
In an empty vector, you cannot pick an element that is TRUE
, therefore:
[1] FALSE
[1] TRUE
[1] FALSE
[1] FALSE
[1] 9
[1] 1.224647e-16
[1] 1.110223e-16
[1] 0
What every computer scientist should know about floating-point arithmetic
[1] TRUE
[1] FALSE
[1] "Mean relative difference: 8.100445e-08"
[1] FALSE
R markdown - markdown - R code - all posts