data.frame {base} | R Documentation |
The function data.frame()
creates data frames, tightly coupled collections
of variables which share many of the properties of matrices and of lists,
used as the fundamental data structure by most of R's modeling software.
data.frame(...);
A data frame, a matrix-like structure whose columns may be of differing types
(numeric
, logical
, factor
and character
and so on).
How the names Of the data frame are created Is complex, And the rest Of this
paragraph Is only the basic story. If the arguments are all named And simple
objects (Not lists, matrices Of data frames) Then the argument names give the
column names. For an unnamed simple argument, a deparsed version Of the
argument Is used As the name (With an enclosing I(...)
removed). For a named
matrix
/list
/dataframe
argument With more than one named column, the names Of
the columns are the name Of the argument followed by a dot And the column name
inside the argument: If the argument Is unnamed, the argument's column names
are used. For a named or unnamed matrix/list/data frame argument that contains
a single column, the column name in the result is the column name in the
argument.
Finally, the names are adjusted to be unique and syntactically valid unless
check.names = FALSE
.