June 2007
Beginner to intermediate
950 pages
27h 8m
English
You can read data from a file using scan (see p. 102) but read.table is much more user-friendly. The read.table function reads a file in table format and automatically creates a dataframe from it, with cases corresponding to rows (lines) and variables to columns (fields) in the file (see p. 107). Much the simplest way to proceed is always to make your dataframe as a spreadsheet in Excel, and always to save it as a tab-delimited text file. That way you will always use read.table for data input, and you will avoid many of the most irritating problems that people encounter when using other input formats.
Read now
Unlock full access