1
我有以下表代碼更改比例表數值爲百分比
weather<-cbind(c(rep("rain",50),rep("sun",70),rep("rain",100),rep("sun",80)))
prop.table(table(weather))
...這會導致下面的輸出:
rain sun
0.5 0.5
我如何更改代碼,以便輸出,而不是變成這樣:
rain sun
50% 50%
有什麼建議嗎?