Berfungsi untuk memeriksa apakah suatu objek merupakan bingkai data, atau memaksanya jika memungkinkan.
as.data.frame(x, row.names = NULL, optional = FALSE, …)<p></p><p># S3 method for character
as.data.frame(x, …,
stringsAsFactors = default.stringsAsFactors())</p><p># S3 method for list
as.data.frame(x, row.names = NULL, optional = FALSE, …,
cut.names = FALSE, col.names = names(x), fix.empty.names = TRUE,
stringsAsFactors = default.stringsAsFactors())</p><p># S3 method for matrix
as.data.frame(x, row.names = NULL, optional = FALSE,
make.names = TRUE, …,
stringsAsFactors = default.stringsAsFactors())</p><p>is.data.frame(x)</p>
| Parameter | Deskripsi |
|---|---|
x |
any R object. |
row.names |
NULL or a character vector giving the row names for the data frame. Missing values are not allowed. |
optional |
logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method. |
… |
additional arguments to be passed to or from methods. |
stringsAsFactors |
logical: should the character vector be converted to a factor? |
cut.names |
logical or integer; indicating if column names with more than 256 (or cut.names if that is numeric) characters should be shortened (and the last 6 characters replaced by " ..."). |
col.names |
(optional) character vector of column names. |
fix.empty.names |
logical indicating if empty column names, i.e., "" should be fixed up (in data.frame) or not. |
make.names |
a logical, i.e., one of FALSE, NA, TRUE, indicating what should happen if the row names (of the matrix x) are invalid. If they are invalid, the default, TRUE, calls make.names(*, unique=TRUE); make.names=NA will use “automatic” row names and a FALSE value will signal an error for invalid row names. |