鉴于以下设置:
area.factor <- cut(state.x77[,"Area"],
breaks=quantile(state.x77[,"Area"],c(0,.25,.75,1)),
labels=c("small","medium","large"),
include.lowest=TRUE)
state <- data.frame(pop=state.x77[,"Population"],
inc=state.x77[,"Income"],
area=area.factor,
region=state.region)
pop.area.region <- with(state,ftable(pop,area,region))
以下两行代码显示相同的结果:
head(ftable(prop.table(pop.area.region,margin=2)))
head(prop.table(pop.area.region,margin=2))
我不明白添加ftable
有什么影响(如果有的话):
head(ftable(prop.table(pop.area.region,margin=2)))