Questions tagged «reshape2»

2
比较聚集(tidyr)以融化(reshape2)
我喜欢reshape2软件包,因为它使生活变得轻松自如。通常,Hadley在其先前的软件包中进行了改进,以启用简化的,运行速度更快的代码。我想我会给tidyr一抡,并从我读我认为gather是非常相似melt的reshape2。但是在阅读了文档之后,我无法gather完成相同的任务melt。 资料检视 这是数据视图(实际数据以dput帖子结尾的形式显示): teacher yr1.baseline pd yr1.lesson1 yr1.lesson2 yr2.lesson1 yr2.lesson2 yr2.lesson3 1 3 1/13/09 2/5/09 3/6/09 4/27/09 10/7/09 11/18/09 3/4/10 2 7 1/15/09 2/5/09 3/3/09 5/5/09 10/16/09 11/18/09 3/4/10 3 8 1/27/09 2/5/09 3/3/09 4/27/09 10/7/09 11/18/09 3/5/10 码 这是melt我尝试的时尚代码gather。我gather该怎么做melt? library(reshape2); library(dplyr); library(tidyr) dat %>% melt(id=c("teacher", "pd"), value.name="date") dat %>% …
67 r  reshape2  tidyr 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.