So I have a table as follows:
data <- structure(list(Variable = c("Content", "Content", "Content",
"Content", "Content", "Content"), content_type = c("LIVE",
"LIVE", "LIVE", "VOD", "VOD", "VOD"), CURRENT_STATUS = c("ACTIVE",
"CANCELLED", "EXPIRED", "ACTIVE", "CANCELLED", "EXPIRED"), `1 Day` = c(0.768763, 0.734808, 0.714794, 1.200606, 0.766533,
0.765004), `7 Day` = c(1.181393, 0.989723, 1.035509,
3.793286, 1.734361, 2.112217), `14 Day` = c(1.431612,
1.123995, 1.206466, 5.428656, 2.226542, 2.868766),
`21 Day` = c(1.609405, 1.189455, 1.313989, 6.671368, 2.485925,
3.381902), `28 Day` = c(1.785089, 1.237489, 1.415171,
7.717914, 2.678954, 3.795692), `35 Day` = c(1.945274,
1.274576, 1.488107, 8.644254, 2.815237, 4.101302), `42 Day` = c(2.095211, 1.306524, 1.540499, 9.465924, 2.932306,
4.320128), `49 Day` = c(2.286882, 1.344057, 1.616501,
10.245316, 3.04714, 4.532644), `56 Day` = c(2.426061,
1.369303, 1.666257, 10.937274, 3.169794, 4.709551), `90 Day` = c(2.974361, 1.435433, 1.812601, 13.656243,
3.419348, 5.263874)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
So each of the columns which numeric data are as follows:
1 Day
7 Day
14 Day
21 Day
...
90 Day
So I want each of the days to be a tick on the x-axis, and the y value to be the value, 3 lines total for each current_status and two tables, for each content_type.
I am expecting it to look something like this:
ggplot(df, aes(x = day, y = count)) +
geom_line(aes(color = CURRENT_STATUS, linetype = CURRENT_STATUS))+
facet_wrap(~content_type)
But I am unsure how to represent the days (which are strings as the variable names) as their actual numeric day values on the x axis (consequently, y being count would be all the values in the table....
So basically, I need to wrangle this table to make sense for a line graph with the specifications above.