Suppose I have this dataframe, df:
UserID <- c(1, 1, 1, 5, 5)
PathID <- c(1,2,3,1,2)
Page <- c("home", "about", "services", "home", "pricing")
df <- data.frame(UserID, PathID, Page)
UserID PathID Page
1 1 1 home
2 1 2 about
3 1 3 services
4 5 1 home
5 5 2 pricing
I would like to know the next Page if Page = home. Not sure how to proceed. Any direction is much appreciated.