I have data with many columns that I want to convert to an igraph object. Some values exist in several columns so I want to add the name of the column to identify those values. Below is a reproducible example.
# sample of original data
head(as.data.frame(Titanic))
 # sample of the data after the col name has been appended to the value of the column 
 data.frame(Class = c("Class_1st","Class_2nd","Class_3rd","Class_Crew","Class_1st","Class_2nd"),
        Sex = c("Sex_Male","Sex_Male","Sex_Male","Sex_Male","Sex_Female","Sex_Female"),
       Age =  c("Age_Child","Age_Child","Age_Child","Age_Child","Age_Child","Age_Child"),
       Survived =   c("Survived_No","Survived_No","Survived_No","Survived_No","Survived_No","Survived_No"), 
Freq = c(0,0,35,0,0,0), stringsAsFactors = FALSE)
 
    