Skip to content

Instantly share code, notes, and snippets.

@elephantum
Created September 2, 2013 19:34
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 elephantum/6416522 to your computer and use it in GitHub Desktop.
Save elephantum/6416522 to your computer and use it in GitHub Desktop.
res <- data.frame(session=NA, dt=NA)
for(event_str in unique(summary$event)) {
event_name <- gsub(pattern=' ', replacement='.', x=event_str, )
tmp <- summary[ summary$event == event_str, c('session', 'dt', 'count')]
names(tmp)[3] <- event_name
res <- merge(x=res, y=tmp, by=c('session', 'dt'), all=TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment