ABSTRACT

Getting data into and out of files is one of the fundamental necessities of a computing platform. There are many facilities for doing so in both R and MATLAB. For reading text data from files, R has the functions read.table, scan, and readLines, while MATLAB has load, fgetl, fscanf, textread, textscan, and importdata. Both R and MATLAB have various functions which will operate on files via what are called file descriptors. In MATLAB, as in the C programming language, the file descriptors 0, 1, and 2 are generally reserved for standard input, standard output, and standard error, the standard input/output channels for programs. When writing a program to analyze a large data file, it is convenient to work with a smaller subset of the data while debugging script. Once the script is working, people can then apply it to the entire data set.