ID <- c('1', '2', '3', '4')
Field_Name <- c('Location', 'Status', 'Company', 'Priority')
Field_Value <- c('Arizona', 'New', 'MyCompany', 'Urgent')
df_1<-data.frame(ID, Field_Name, Field_Value)
field_name_v <- as.factor(df_1$Field_Name)
custom_fields_df2 <- data.frame(matrix(ncol =((length(field_name_v))),
nrow = (nrow(df_1))))
colnames(custom_fields_df2) <- field_name_v
custom_fields_df2$ID <-ID
This may seem like a weird ask, but it is needed for a rather large dataset. I know this is probably super simple but I cannot figure it out. If you look at df_1 it has the Field_Name value which denotes a custom field added by users. In the custom_fields_df2 I am trying to create a horizontal chart where each unique value in the df_1$Field_Name is a column and the Field_Value is joined in under the column where the Field_Name = column name and ID matches. Any help would be greatly appreciated.