시작하기무료로 시작하기

read.delim()과 read.delim.raw() 비교

하드 드라이브에 연속된 청크 데이터가 있을 때, iotools는 다음 청크를 불러오면서 동시에 raw 객체를 data.frame이나 matrix로 변환할 수 있습니다. 이러한 최적화 덕분에 iotools는 매우 큰 파일도 빠르게 처리할 수 있습니다.

이 연습은 강의의 일부입니다

R에서 확장 가능한 데이터 처리

강의 보기

연습 안내

  • read.delim()을 사용해 파일 읽기 시간을 5번 측정하세요.
  • read.delim.raw()을 사용해 파일 읽기 시간을 5번 측정하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Load the iotools and microbenchmark packages
___
___

# Time the reading of files
___(
    # Time the reading of a file using read.delim five times
    ___("mortgage-sample.csv", header = FALSE, sep = ","),
    # Time the reading of a file using read.delim.raw five times
    ___("mortgage-sample.csv", header = FALSE, sep = ","),
    times = ___
)
코드 편집 및 실행