Skip to content

Instantly share code, notes, and snippets.

@mhkeller
Created October 29, 2012 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhkeller/3975177 to your computer and use it in GitHub Desktop.
Save mhkeller/3975177 to your computer and use it in GitHub Desktop.
sum columns with apply
apply(df[,c("col1","col2")], 1, sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment