melt(data,id.vars=c(),measure.vars=(),variable.name="",value.name="")
melt(muying3,id.vars = "采购员", measure.vars =c("北京在库库存","上海在库库存","广州在库库存","成都在库库存","武汉在库库存","沈阳在库库存","其它机构库存"),variable.name = "仓库",value.name="合计总库存" )
# "muying3$采购员" 是错误格式
dcast(data, formula, fun.aggregate = NULL, ..., margins = NULL,subset = NULL, fill = NULL, drop = TRUE value.var = guess_value(data)
dcast(data2,采购员~仓库,value.var = "合计总库存",fun.aggregate = sum)
#采购员~仓库 不加引号 value.var 要指定内容
网友评论