I have this data called my.data
. I want to melt all columns together and get the result in three columns. The final data should have three columns-
1. key.related column
2. IBS values from all three columns (IBS_2_samples IBS_4_samples IBS_8_samples)
3. Column indicating IBS columns types (i.e, column values should be IBS_2_samples IBS_4_samples IBS_8_samples accordingly).
Please teach me how to melt this data so I can make line plot with it (as shown here:Plot multiple lines (data series) each with unique color in R). Thanks
my.data<- structure(list(key.related = c("G11F:G11F", "G11M:G11M", "G29P:G29P",
"G29P:G29S"), IBS_2_samples = c(0.533, 0.629, NA, NA), IBS_4_samples = c(1.01,
1.04, 0.83, 0.349), IBS_8_samples = c(1.11, 1.11, 0.956, 0.42
)), .Names = c("key.related", "IBS_2_samples", "IBS_4_samples",
"IBS_8_samples"), row.names = c(NA, 4L), class = "data.frame")