Does not quite answer why , but tries to shed light on what .
Let's start by creating some sequences of numbers:
x <- 1:10
z <- c(1,2,3,4,5,6,7,8,9,10)
typeof(x)
# [1] "integer"
typeof(z)
# [1] "double"
class(x)
# [1] "integer"
class(z)
# [1] "numeric"
As @docendodiscimus noted, they may look the same, but they are different. This is important if you are checking if they are identical:
identical(x,z)
x == z
== " , ". (. ?==), identical() - " , . TRUE FALSE ". (. ?identical).
, seq()
y1 <- seq(1,10)
y2 <- seq(1,10, by = 1)
typeof(y1)
typeof(y2)
class(y1)
class(y2)
by = ... 1 , .
, , ( ). help ,
" , " [ , ]
mode numeric
mode(y1)
# [1] "numeric"
mode(y2)
# [1] "numeric"
mode(x)
# [1] "numeric"
mode(z)
# [1] "numeric"
The R Inferno ( ).
, z
z <- as.integer(c(1,2,3,4,5,6,7,8,9,10))
typeof(z)
class(z)
identical(x,z)