1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable Data Processing in R

Connected

Exercise

Reading raw data and turning it into a data structure

As mentioned before, part of what makes iotools fast is that it separates reading data from the hard drive from converting the binary data it into a data.frame or matrix. Data in their binary format are copied from the hard drive into memory as raw objects. These raw objects are then passed to optimized functions that turn them into data.frame or matrix objects.

In this exercise, you'll learn how to separate reading data from the disk (using the readAsRaw() function), and then convert the raw binary data into a matrix or data.frame (using the mstrsplit() and dstrsplit() functions).

Instructions

100 XP
  • Read "mortgage-sample.csv" as a raw vector.
  • Convert the raw vector contents to a matrix of integers.
  • Convert the raw vector contents to a data.frame with 16 integer columns.