You can create tables in R programming in two ways as listed below:
You can use the table function to create a table and give the argument as two columns of data as shown below:
>data <- table(data$column1,data$column2)
In many instances, you will have the data in the form of a table, and you have to make a new table that contains the data. In such cases, you can do it as follows:
> colnames(dataset) <- c("USA","UK","Australia")
> rownames(dataset) <- c("Cricket","Football","Basketball")
dataset <- as.table(dataset)
If you are looking for an online course to learn R programming, check out this R Programming Training by Intellipaat.