Compare read.delim() and read.delim.raw()
When processing a sequence of contiguous chunks of data on a hard drive, iotools can turn a raw object into a data.frame or matrix while - at the same time - retrieving the next chunk of data. These optimizations allow iotools to quickly process very large files.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Scalable Data Processing in R
คำแนะนำการฝึกหัด
- Time the reading of a file using
read.delim()five times. - Time the reading of a file using
read.delim.raw()five times.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# 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 = ___
)