问答详情
源自:4-7 总结数据信息

怎么我按照流程xtabs用不了?

x<-data.frame(name=c("a","b","a","b","b"),sex=c("m","f","f","f","m"),age=c(10,15,NA,11,56))

head(x)

tail(x)

summary(x)

xtabs(Freq~sex+name,data=x)


提问者:Athrundyj 2019-03-07 00:41

个回答

  • 菜鸟红
    2019-03-07 10:15:14
    已采纳

    你的x表中没有Freq这个变量啊,添加1栏Freq都设值为1,就行了