-2
這似乎很容易。但是我堅持了一個小時以上。R程序從函數中取一個變量名[編輯]
function(directory, pollutant , id = 1:332)
我想把污染物的價值說成是'硝酸鹽'。
我的數據分配給變量「MYDATA」
mydata$nitrate[ "some condition"]
但我必須要通過像
mydata$pollutant . How could I assign the value from pollutant with $ .
有沒有辦法做到這一點。
爲什麼不使用'MYDATA [污染物]',而不是使用'$'? –
@MatthewLundberg。但我必須在其中添加一些條件。就像我只需要選擇部分數據$ nitrate [data $ ID> = 5]&data $ ID <= 10] – user3116355
@ user3116355爲什麼不提供一些示例數據? – nrussell