R - Integer

Card Puncher Data Processing

About

The integer class

Initialization

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

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"

Colon

With the sequence operator

> v=5:10
> str(v)
 int [1:6] 5 6 7 8 9 10





Discover More
Card Puncher Data Processing
R - (Datatype|Type|Storage Mode) of an object (typeof, mode)

In the C code underlying R, all objects are pointers to a structure with typedef SEXPREC; the different R data types are represented in C by SEXPTYPE, which determines how the information in the various...
Card Puncher Data Processing
R - Class

A class is just an attribute of an object. You can remove the attribute with the function . The class with then become the type A list can have different class. unclass returns (a copy of) its...
Card Puncher Data Processing
R - Factor (Category, Enumerated Type)

The factor function is used to encode a vector as a factor (ie categorical data). When used with a numeric or a date, a binning function will return a factor. From numeric to a category (For instance,...
Card Puncher Data Processing
R - Vector

The Vector in R contains elements of the same class. A Vector with different class of objects is a list. A vector (as every object) can also have . Almost all data in R is a vector or is based upon...
Card Puncher Data Processing
R - rep (repetition of element)

where: x is an object to replicate (a vector (of any mode including a list) or a factor or (for rep only) a POSIXct or POSIXlt or Date object; or an S4 object containing such an object. times is an...



Share this page:
Follow us:
Task Runner