I have this data:
structure(list(type = c("journal", "all", "similar_age_1m", "similar_age_3m",
"similar_age_journal_1m", "similar_age_journal_3m"), count = c("13972",
"754555", "22408", "56213", "508", "1035"), rank = c("13759",
"754043", "22339", "56074", "459", "947"), pct = c("98.48", "99.93",
"99.69", "99.75", "90.35", "91.50")), .Names = c("type", "count",
"rank", "pct"), row.names = c(NA, -6L), class = "data.frame")
I would like to turn it into a single line with column names 2:4with a prefix of the corresponding type. for example journal.count, journal.rank... What is the fastest way to do this? For some reason, dcastand reshapethey do not do it for me, and my decision a little too cumbersome.
source
share