我有数据集:
top100_repository_name month monthly_increase monthly_begin_at monthly_end_with
Bukkit 2012-03 9 431 440
Bukkit 2012-04 19 438 457
Bukkit 2012-05 19 455 474
CodeIgniter 2012-03 15 492 507
CodeIgniter 2012-04 50 506 556
CodeIgniter 2012-05 19 555 574
我使用以下 R 代码:
library(reshape)
latent.growth.data <- read.csv(file = "LGC_data.csv", header = TRUE)
melt(latent.growth.data, id = c("top100_repository_name", "month"), measured = c("monthly_end_with"))
cast(latent.growth.data, top100_repository_name + month ~ monthly_end_with)
我想用它来创建具有以下结构的数据集:
top100_repository_name 2012-03 2012-04 2012-05
Bukkit 440 457 474
CodeIgniter 507 556 574
但是,当我运行我的代码时,我得到以下输出:
Using monthly_end_with as value column. Use the value argument to cast to override this choice
Error in `[.data.frame`(data, , variables, drop = FALSE) :
undefined columns selected
如何修改我的代码以生成所需的输出?