0 votes
1 view
in R Programming by (6.5k points)
Can anyone tell me how to create tables in R programming?

1 Answer

0 votes
by (35.4k points)

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.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...