2017-02-16 35 views

回答

0

你可以這樣做:

which.max(data$women1990) 

要獲得的行號,然後你就可以使用:

row.names(data)[which.max(data$women1990)] 

要獲得該行的名稱。

更多通用代碼(當你不找最大的,但一定值),使用:

which(data$women1990==max(data$women1990)) # Put desired value after the == 
+1

「把所需的值」,除非你正在尋找一個數字,然後看到http://stackoverflow.com/questions/2769510/numeric-comparison-difficulty-in-r –

相關問題