We can use dcast from data.table. Convert the 'data.frame' to 'data.table' (setDT(df1)), then dcast the dataset to 'wide' format by creating a sequence id (rowid - from data.table does that for the 'Name' variable), pass it on the formula, and specify the value.var as "Event"
library(data.table) dcast(setDT(df1)[order(Name, Time)], Name ~ rowid(Name), value.var = "Event") # Name 1 2 3 #1: Nate Log1 Log2 Log5 #2: Serg Log3 Log1 NA
Or using tidyverse
library(dplyr) library(tidyr) df1 %>% group_by(Name) %>% arrange(Name, Time) %>% mutate(ind = row_number()) %>% select(-Time) %>% spread(ind, Event) # Name `1` `2` `3` #* <chr> <chr> <chr> <chr> #1 Nate Log1 Log2 Log5 #2 Serg Log3 Log1 <NA>
Log3asthe first value by accident or on purpose?