Data Frames

At this point you probably recognize the many similarities between data frames and the other types of objects in S-PLUS. Data frames have dimension, row names, and names attributes. Blanks in data frames are represented by NA, just like blank entries in numeric vectors (and factors).

Matrices may be converted to data frames by using the data.frame command (there's no as.frame). Data frames may be converted to matrices with as.matrix, although keep in mind that matrices, like vectors, can only contain one type of data while data frames can contain several. If there are any characters in the data frame, converting it to a matrix will result in all of the elements being converted to characters.



Pantelis Vlachos
1/15/1999