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)
你的x表中没有Freq这个变量啊,添加1栏Freq都设值为1,就行了