【发布时间】:2020-01-25 20:40:48
【问题描述】:
我有一个数据框,它的结构对于某些用途来说很好,但绝对不适合 GGPLOT。有没有改造的功能
x <- data.frame(head_1 = c(1,2,3,1,2,3),
head_2 = c(4,5,6,1,2,3),
date = c("01-01-2019","01-01-2019","01-01-2019","02-01-2019","02-01-2019","02-01-2019"))
进入
y <- data.frame(type= c("head_1","head_1","head_1","head_1","head_1","head_1",
"head_2","head_2","head_2","head_2","head_2","head_2"),
date = c("01-01-2019", "01-01-2019","01-01-2019","01-01-2019","01-01-2019","01-01-2019",
"02-01-2019", "02-01-2019","02-01-2019","02-01-2019","02-01-2019","02-01-2019"),
value= c(1,2,3,1,2,3,4,5,6,1,2,3 ))
【问题讨论】: