R> class(1:3)
[1] "integer"
R> class(c(1,2,3))
[1] "numeric"
R>
In short, :
since the sequence operator returns an integer, "because that's what people really want."
Hence:
R> identical(1:3, c(1L,2L,3L))
[1] TRUE
R> identical(1*(1:3), c(1,2,3))
[1] TRUE
R>
source
share