I am trying to arrange my current data set so that all the Visits are arranged for all the Individuals. I tried the method suggested in this question and it works but only shows the values for the first individual.
Data:
structure(list(Individual = c("John", "John", "John", "Anna",
"Anna", "Anna", "Seth", "Seth", "Seth"), Visit = c("Last", "First",
"Review", "Last", "First", "Review", "Last", "First", "Review"
), Amount = c(25, 100, 75, 25, 100, 75, 25, 100, 75)), row.names = c(NA,
-9L), class = c("tbl_df", "tbl", "data.frame"))
Attempted code:
target <- c("First","Review","Last")
Visit <- Visit[match(target, Visit$Visit),]