R -3- Creating various objects

Vectors are not the only recipients  of your datasets (objects) in R. You will find out that you can also store lists of numbers/words, collections of data, matrices and so on under a name or variable. This will not only save your time and energy, but also prevent you from making mistakes and increase consistency in your calculations. Let’s see how to create these objects.



matrix coordinates
Objects can also store series of data arranged in the form of a two-dimensional matrix, i.e. an arrangement of data in rows and columns. The function matrix() creates this type of object, but requires a few arguments to properly “draw” the matrix and dispatch the data. First, let’s agree that […]

2. Objects that contain a matrix


long.box array
An array is nothing more than a matrix with more than two dimensions. It is basically a series of two-dimensional matrices “on top of each other”; in other words, a matrix is an array with only two dimensions, or only one layer. To build an array, there is a function […]

3. Objects that contain an array




table random list
The table() function in R is used to create… a table. So far, so good. In fact, this is a rather simple function that gathers data and creates a contingency table or frequency table, in other words, a table which counts the number of occurrences of any unique value in […]

5. Objects that contain a table


Dataframes are a central type of object when working with statistics in R. They are actually simple two-dimensional matrices arrays which contain your data, arranged in a rather specific manner. They are in a way so special when working with statistics in R that they deserve their own, dedicated page. […]

6. Objects that contain a dataframe