Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

這是一般的記憶體配置錯誤。常見的問題是革命 R 嘗試從您的資料檔,以處理單一的資料區塊的記憶體中的資料,一次讀取太多的資料列。

首先,請嘗試下列動作,以解決這個問題︰

在您的 rxImport() 陳述式中設定 'rowsPerRead' 的引數的小值。請試著的 '10000' 或更少的值。您可能需要嘗試不同的設定

此選項以尋找的值,很適合,並盡快將資料匯入。

 

如果這不會幫助您的 csv 檔有很多資料行,它可以協助一次匯入的 'x' 的資料行。例如,如果您為 5000 的資料行的資料集,您可能想要匯入 50 的資料行的資料一次,並寫出 50 到新的 XDF 檔案的資料行的資料附加到該現有的 XDF 檔。

以下是一些範例 R 程式碼即可︰

varNames <- readLines("mycsv.txt", n=1) colsPerRead <- 50   ## Set how many columns to read from the csv file at a time. You may want to initially set this to a larger value, say 100. 
numReadsFromFile <- length(varNames/colsPerRead)

for (i in 1:numReadsFromFile) 

 tempdf <- rxImport(inData = "C:/MyRData/data.csv", varsToKeep = paste(varNames[((i-1)*colsPerRead)+1:(((i-1)*colsPerRead)+1)+colsPerRead], sep = ","), 
 rowsPerRead = 10000) 
 rxDataFrameToXdf(data = tempdf, ouFile = "C:/MyRData/data.xdf", append = "cols") 
}


Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×