0
在R工作室,我正在尋找創建國家名稱的矢量。他們被包圍在我的數據集列1 Countryvec給人因子名追加矢量不給名稱
"Australia Australia ..."
X只是給俄羅斯,全國36個的名字,國家最終被
1,1,...,2,2,...,4,4.. etc.
他們也不會爲了,3最終在42和43之間。我如何使這些數字成爲因素?
gdppc=read.xlsx("H:/dissertation/ALL/YAS.xlsx",sheetIndex = 1,startRow = 1)
countryvec=gdppc[,1]
country=c()
for (j in 1:43){
x=rep(countryvec[j],25)
country=append(country,x)
}
嗨,轉換vec tor之前工作很好,謝謝 –