這個頁面中的新功能。 我一直在使用這段代碼沒有成功。傳遞函數中的參數列表R
我有一個參數列表。
price<-seq(10,100,length=10)
alfa<-seq(2,3,length=4)
beta<-seq(0.1,0.2,length=4)
名單是:
[[1]]
[1] 10 20 30 40 50 60 70 80 90 100
[[2]]
[1] 2.000000 2.333333 2.666667 3.000000
[[3]]
[1] 0.1000000 0.1333333 0.1666667 0.2000000
,我想什麼來是創建一個功能,每一個價格,做到以下幾點。我嘗試了lapply函數,但沒有結果。
price*beta[1]+alfa[1]
price*beta[2]+alfa[2]
price*beta[3]+alfa[3]
price*beta[4]+alfa[4]
謝謝!
請分享你與'嘗試lapply()' – ottlngr