我正在尝试将以下数据直接输入到R中(代表列联表)
Area School Coffeshop Hospitals Parks Totatl
Washington 142 120 20 20 302
Seattle 120 140 30 40 330
Total 262 260 50 60 632
我的代码是这样的:
n<-c("Area","School","Cofeeshop","Hospitals","Parks","Total")
x<-c("Washington",142,120,20,20,302)
y<-c("Seattle",120,140,30,40,330)
z<-c("Total",262,260,50,60,631)
data<-cbind(n,x,y,z)
data<-data.frame(data)