Converting inputs to data types suitable for analysis

Another aspect of data cleaning is investigating the input data and shaping it to conform to your analysis design needs. The third step of the SFCA approach is convert. Specifically, converting the data from one data type to another.

Converting between data types

The R environment stores data in one of the several data types. You will experience five different data types in the Bike Sharing Analysis Project:

Data type

Explanation

Example

Numeric

A number having a decimal value

9.84

Integer

A number without decimals

3

Character

A string variable

"www.google.com"

Factor

A categorical variable that has a character and integer representation

"ad campaign", "blog": 1,2

Get Introduction to R for Business Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.