Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 18, 2020 19:24
Show Gist options
  • Save NyaGarcia/cbbf287c49d8fc1838f72ef0f40acc0b to your computer and use it in GitHub Desktop.
Save NyaGarcia/cbbf287c49d8fc1838f72ef0f40acc0b to your computer and use it in GitHub Desktop.
Calculating total values for rows with rowSums()
> rowSums(table(mtcars$gear, mtcars$cyl))
3 4 5
15 12 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment