From Wikipedia:
1 == sqrt(2)
[1] FALSE
3 == sqrt(9)
[1] TRUE
c(TRUE == -1,TRUE == 0,TRUE == 1,TRUE == 3.14)
[1] FALSE FALSE TRUE FALSE
c(FALSE == -1,FALSE == 0,FALSE == 1,FALSE == pi)
[1] FALSE TRUE FALSE FALSE
c(TRUE < FALSE, TRUE > FALSE, TRUE == FALSE)
[1] FALSE TRUE FALSE
TRUE == 1; FALSE == 0
[1] TRUE
[1] TRUE
x <- c(TRUE, FALSE, TRUE, FALSE, TRUE)
c(sum(x), mean(x), length(x))
[1] 3.0 0.6 5.0
x <- c(1,2,3,4,3,1,2,3,3,4,1,3,4,3)
x
[1] 1 2 3 4 3 1 2 3 3 4 1 3 4 3
c(sum(x == 3), sum(x < 3))
[1] 6 5
\[ \left\{ \ldots, -3, -2, -1, 0, 1, 2, 3, \ldots \right\} \]
\[ 123.45 = 1.2345 \times 10^2 \]
exp(1)
[1] 2.718282
is.numeric(exp(1))
[1] TRUE
is.integer(exp(1))
[1] FALSE
is.integer(2)
[1] FALSE
as.integer(2)
[1] 2
as.numeric(exp(1)); as.integer(exp(1))
[1] 2.718282
[1] 2
as.character(exp(1))
[1] "2.71828182845905"
exp(1); as.integer(exp(1)); round(exp(1))
[1] 2.718282
[1] 2
[1] 3
pi; as.integer(pi); round(pi); as.character(pi)
[1] 3.141593
[1] 3
[1] 3
[1] "3.14159265358979"