To read an entire data frame directly, the external file must have a special form.
Figure 2: Input file form with names and row labels
By default numeric items (except row labels) are read as numeric variables and non-numeric variables, such as Cent.heat in the example, as factors. This can be changed if necessary.
The function read.table() can then be used to read the data frame directly
HousePrice <- read.table("houses.data")
Often you will want to omit including the row labels directly and use the default labels. In this case the file may omit the row label column as in Figure 3
Figure 3: Input file form without row labels
The data frame may then be read as
HousePrice <- read.table("houses.data", header=T)
where the heading=T option specifies that the first line is a line of headings, and hence, by implication from the form of the file, that no explicit row labels are given.