Skip to content

Instantly share code, notes, and snippets.

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