R에서 확장 가능한 데이터 처리
Simon Urbanek
Member of R-Core, Lead Inventive Scientist, AT&T Labs Research
모든 데이터가 처리될 때까지 1~3 반복
iotools 패키지에서는 데이터의 물리적 로드와 R 객체로의 파싱이 분리되어 유연성과 성능을 향상시킵니다.
readAsRaw()는 전체 데이터를 원시 벡터로 읽음read.chunk()는 데이터를 청크 단위로 원시 벡터에 읽음mstrsplit()은 원시 데이터를 행렬로 변환dstrsplit()은 원시 데이터를 데이터 프레임으로 변환read.delim.raw() = readAsRaw() + dstrsplit()
# Open a file connection
fc <- file("data-file.csv", "rb")
# Read the first line if the data has a header
readLines(fc, n = 1)
....
# Code to import and parse the data
....
# Close the file connection
close(fc)
R에서 확장 가능한 데이터 처리