Skip to content

Instantly share code, notes, and snippets.

@elephantum
Created September 2, 2013 19:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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