R - Integer

> Procedural Languages > R

1 - About

The integer class

Advertising

3 - Initialization

Numeric format is the default number system. If you explicitly want an integer, you need to specify it with the L suffix.

3.1 - Combine

When using the combine function, integer must be also specified with the suffix L

> v=c(1L,3L,-5L)
> str(v)
 int [1:3] 1 3 -5
> v <- c(1L)
> class(v)
[1] "integer"

3.2 - Colon

With the sequence operator

> v=5:10
> str(v)
 int [1:6] 5 6 7 8 9 10
lang/r/integer.txt · Last modified: 2017/02/12 21:02 by gerardnico