September 2018
Beginner
206 pages
4h 27m
English
Herein, we will use the table() function to create three different types of tables in R. In order to do so, the following steps need to be executed:
Load the iris dataset and create a one-way table of the Species variable using the following code:
table(iris$Species)
Load the diamonds dataset and create a two-way table of the cut and color variables using the following code:
table(diamonds$cut, diamonds$color)
Create a three-way table of the cut, color, and clarity variables from the diamonds dataset as follows:
table(diamonds$cut, diamonds$color, diamonds$clarity)
Load the mtcars dataset if it is not already loaded in your environment. Create a table of the mpg variable ...
Read now
Unlock full access