I searched but I could not find an answer for a question similar to this. I am working with a data set that has a column with metadata about the remaining data columns. I want to split that original data set into a new data frame looking only at one of the variables with column headers from the metadata column. For example:
id metadata var1 var2 var3
001 A 1 1 5
002 B 3 2 4
003 A 2 4 7
004 C 8 4 1
and then I want the output to look something like this with only the values from the var1 column:
id var1.A var1.B var1.C
001 1
002 3
003 2
004 8
and then I would write loop to export that to a csv and propagate it down the rest of the columns for a different file for each.