Skip to content

Instantly share code, notes, and snippets.

@mhkeller
Created October 29, 2012 17:48
Show Gist options
  • Select an option

  • Save mhkeller/3975177 to your computer and use it in GitHub Desktop.

Select an option

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