Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 18, 2020 19:24
Show Gist options
  • Save NyaGarcia/faf54a1e82016628c54387f72bff481e to your computer and use it in GitHub Desktop.
Save NyaGarcia/faf54a1e82016628c54387f72bff481e to your computer and use it in GitHub Desktop.
Calculating total values for columns with colSums()
> colSums(table(mtcars$gear, mtcars$cyl))
4 6 8
11 7 14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment