I am trying to extract rows and place these groups of rows into columns. The rows I need to extract are of uneven length. Not sure how to specify the conditions and apply the loop (?).
Here is the dataset I'm working with:
Data1 <- data.frame("Example" = c("Word A", "URL", "URL", "URL",
"Word B", "URL",
"Word C", "URL", "URL"))
I want it to look like this:
Data2 <- data.frame("Example 1" = c("Word A", "URL", "URL", "URL"),
"Example 2" = c("Word B", "URL", NA, NA),
"Example 3" = c("Word C", "URL", "URL", NA))
Thanks anyone who can help!