Skip to content

Instantly share code, notes, and snippets.

@yalla
Created September 23, 2011 17:13
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 yalla/8049f54780cf0f18147b to your computer and use it in GitHub Desktop.
Save yalla/8049f54780cf0f18147b to your computer and use it in GitHub Desktop.
aggregate with "with" :-)
> with(cured_data, aggregate(x, list( time(x) - as.numeric(time(x)) %% 360, type = type), FUN=length))
type x
2011-09-22 14:54:00 1 36575
2011-09-22 15:00:00 1 44846
2011-09-22 15:06:00 1 42224
2011-09-22 15:12:00 1 43608
2011-09-22 15:18:00 1 41442
2011-09-22 15:24:00 1 5377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment