Like to make a new data set where column 1 is distinct categorical variable and column 2 through to Column X, are the associated values of A. This is a one to many relationship.
When using spread got an error message given the 1 to many relationship
library(tidyr)
new_data <- spread(original_data, `State name`, `Park Location`)
Col 1 Col 2 Transform to Col 1 Col 2 Col 3 Col 4
A C A C B A
A B B A
A A
B A
Error: Each row of output must be identified by a unique combination of keys.
Keys are shared for 687 rows: