Module 9: Tabulating Tabular Data in R
Hi everyone!
This week's assignment focuses on using R to make tables from data frames. We also explore adding sum totals for both rows and columns in our contingency tables and creating proportion tables.
1.
Generate simple table in R that consists of four rows: Country, age, salary and purchased.
2. Generate contingency table also know as r x c table (Chapter 7, p.135) using mtcars dataset.
>assignment9 <- table(mtcars$gear, mtcars$cyl, dnn=c("fill out here")
2.1 Add the addmargins() function to report on the sum totals of the rows and columns of assignment9 table
>addmargins(assignment9)
Comments
Post a Comment