Data Types and Basic Operations:
1. Objects:
In every computer language variables provide a means of accessing the data stored in memory. R does not provide direct access to the computer’s memory but rather provides a number of specialized data structures we will refer to as objects.These objects are referred to through symbols or variables.
R has five basic or atomic classes of objects:
2.1 Vectors:
1. Objects:
In every computer language variables provide a means of accessing the data stored in memory. R does not provide direct access to the computer’s memory but rather provides a number of specialized data structures we will refer to as objects.These objects are referred to through symbols or variables.
R has five basic or atomic classes of objects:
- characters
- numeric(real numbers)
- integer
- complex
- logical(True or False)
2.1 Vectors:
The most basic object in R is vector. A vector can only contain objects of the same class. But the exception is a 'list', which is represent as a vector but can contain objects of different classes. Empty vectors can be created with the vector() function.
2.2 Lists:
Lists are another kind of data storage. Lists have elements, each of which can contain any type of R object, i.e. the elements of a list do not have to be of the same type.
2.2 Lists:
Lists are another kind of data storage. Lists have elements, each of which can contain any type of R object, i.e. the elements of a list do not have to be of the same type.