이것은 내가 한 방법입니다 (원본 데이터에 헤더가 없음).
첫 번째 단계 - 모든 파일이 동일한 폴더에 있는지 확인하십시오. 작업 디렉토리를 폴더로 설정하십시오.
#load the ffbase library
library(ffbase)
#create a vector of the files that I want to load
temp = list.files(pattern="*.csv")
#create the first ffdf object for i = 1, this is necessary to establish the ff dataframe to append the rest
for (i in 1)
mydata <- read.csv.ffdf(file=temp[i], header=FALSE, VERBOSE=TRUE
, first.rows=100000, next.rows=100000, colClasses=NA)
#loop through the remaining objects
for (i in 2:length(temp))
mydata <- read.csv.ffdf(x = mydata, file=temp[i], header=FALSE, VERBOSE=TRUE
, first.rows=100000, next.rows=100000)
파일의 크기는 얼마나됩니까? –
실제로 각 파일에 27 개의 파일이 있습니다. 총 10GB이지만 대부분의 상태는 작고 (<100MB) 두 개의 상태가 다소 큽니다 (> 4GB> 내 RAM) – LucasMation
read.csv.ffdf의 인수 'x'를 사용하여 데이터를 기존 ffdf에 추가 할 수 있습니다. 다른 csv 파일의 구조가 같은 경우. – jwijffels