美文网首页
R语言数据整形-reshape2

R语言数据整形-reshape2

作者: 付德刚Q | 来源:发表于2018-01-15 16:20 被阅读0次

    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 要指定内容

    相关文章

      网友评论

          本文标题:R语言数据整形-reshape2

          本文链接:https://www.haomeiwen.com/subject/lildoxtx.html