我正在使用相關的EdX課程學習RevoScaleR(R服務器)。是否可以從RexScaleR(R服務器)中的rxDataStep()調用統計函數
我認爲我可以使用rxDataStep()來傳遞函數或構造函數,這些函數或構造函數用坐在磁盤上的數據塊傳遞給「變換」參數,rxDataStep將數據塊轉換爲數據幀。 rxDataStep()繼續,直到處理完所有數據並完成轉換。因此,例如,下面的代碼創建一個新列「tip_percent」:
rxDataStep(nyc_xdf, nyc_xdf,
transforms = list(tip_percent = ifelse(fare_amount > 0 & tip_amount < fare_amount, round(tip_amount * 100/fare_amount, 0), NA)),
overwrite = TRUE)
我的問題是,如果我可以使用rxDataStep()當數據做飼料用的數據塊的統計功能,如LM()的情況下,不適合在RAM中。第一次嘗試沒有成功。即:
rxDataStep(nyc_xdf, transforms = list(lm1 = lm(fare_amount ~ trip_distance)))
返回一條錯誤消息:
ERROR: The sample data set for the analysis has no variables.
如果rxDataStep()是不是要走的路,什麼是正確的?
您的建議將不勝感激。