Created
March 18, 2020 15:50
-
-
Save NyaGarcia/dd4037d8790d15cbdc962aa2f0f55d88 to your computer and use it in GitHub Desktop.
Creating a contingency table with percentages rather than values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prop.table(table(mtcars$gear, mtcars$cyl)) | |
4 6 8 | |
3 0.03125 0.06250 0.37500 | |
4 0.25000 0.12500 0.00000 | |
5 0.06250 0.03125 0.06250 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment