The R Project SVN R

Rev

Rev 69952 | Rev 78484 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69952 Rev 74373
Line 1... Line 1...
1
% File src/library/base/man/as.data.frame.Rd
1
% File src/library/base/man/as.data.frame.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2016 R Core Team
3
% Copyright 1995-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{as.data.frame}
6
\name{as.data.frame}
7
\title{Coerce to a Data Frame}
7
\title{Coerce to a Data Frame}
8
\alias{as.data.frame}
8
\alias{as.data.frame}
Line 38... Line 38...
38
 
38
 
39
\method{as.data.frame}{list}(x, row.names = NULL, optional = FALSE, \dots,
39
\method{as.data.frame}{list}(x, row.names = NULL, optional = FALSE, \dots,
40
              cut.names = FALSE, col.names = names(x), fix.empty.names = TRUE,
40
              cut.names = FALSE, col.names = names(x), fix.empty.names = TRUE,
41
              stringsAsFactors = default.stringsAsFactors())
41
              stringsAsFactors = default.stringsAsFactors())
42
 
42
 
43
\method{as.data.frame}{matrix}(x, row.names = NULL, optional = FALSE, \dots,
43
\method{as.data.frame}{matrix}(x, row.names = NULL, optional = FALSE,
-
 
44
              make.names = TRUE, \dots,
44
              stringsAsFactors = default.stringsAsFactors())
45
              stringsAsFactors = default.stringsAsFactors())
45
 
46
 
46
is.data.frame(x)
47
is.data.frame(x)
47
}
48
}
48
\arguments{
49
\arguments{
Line 52... Line 53...
52
  \item{optional}{logical. If \code{TRUE}, setting row names and
53
  \item{optional}{logical. If \code{TRUE}, setting row names and
53
    converting column names (to syntactic names: see
54
    converting column names (to syntactic names: see
54
    \code{\link{make.names}}) is optional.  Note that all of \R's
55
    \code{\link{make.names}}) is optional.  Note that all of \R's
55
    \pkg{base} package \code{as.data.frame()} methods use
56
    \pkg{base} package \code{as.data.frame()} methods use
56
    \code{optional} only for column names treatment, basically with the
57
    \code{optional} only for column names treatment, basically with the
57
    meaning of \code{\link{data.frame}(*, check.names = !optional)}.}
58
    meaning of \code{\link{data.frame}(*, check.names = !optional)}.
-
 
59
    See also the \code{make.names} argument of the \code{matrix} method.}
58
  \item{\dots}{additional arguments to be passed to or from methods.}
60
  \item{\dots}{additional arguments to be passed to or from methods.}
59
  \item{stringsAsFactors}{logical: should the character vector be converted
61
  \item{stringsAsFactors}{logical: should the character vector be converted
60
    to a factor?}
62
    to a factor?}
61
  %% list method:
63
  %% list method:
62
  \item{cut.names}{logical or integer; indicating if column names with
64
  \item{cut.names}{logical or integer; indicating if column names with
63
    more than 256 (or \code{cut.names} if that is numeric) characters
65
    more than 256 (or \code{cut.names} if that is numeric) characters
64
    should be shortened (and the last 6 characters replaced by \code{" ..."}).}
66
    should be shortened (and the last 6 characters replaced by \code{" ..."}).}
65
  \item{col.names}{(optional) character vector of column names.}
67
  \item{col.names}{(optional) character vector of column names.}
66
  \item{fix.empty.names}{logical indicating if empty column names, i.e.,
68
  \item{fix.empty.names}{logical indicating if empty column names, i.e.,
67
    \code{""} should be fixed up (in \code{\link{data.frame}}) or not.}
69
    \code{""} should be fixed up (in \code{\link{data.frame}}) or not.}
-
 
70
  %% matrix method:
-
 
71
  \item{make.names}{a \code{\link{logical}}, i.e., one of \code{FALSE, NA, TRUE},
-
 
72
    indicating what should happen if the row names (of the matrix
-
 
73
    \code{x}) are invalid.  If they are invalid, the default,
-
 
74
    \code{TRUE}, calls \code{\link{make.names}(*, unique=TRUE)};
-
 
75
    \code{make.names=NA} will use \dQuote{automatic} row names and a
-
 
76
    \code{FALSE} value will signal an error for invalid row names.}
68
}
77
}
69
\value{
78
\value{
70
  \code{as.data.frame} returns a data frame, normally with all row names
79
  \code{as.data.frame} returns a data frame, normally with all row names
71
  \code{""} if \code{optional = TRUE}.
80
  \code{""} if \code{optional = TRUE}.
72
 
81