The R Project SVN R

Rev

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

Rev 27709 Rev 28014
Line 10... Line 10...
10
array(data = NA, dim = length(data), dimnames = NULL)
10
array(data = NA, dim = length(data), dimnames = NULL)
11
as.array(x)
11
as.array(x)
12
is.array(x)
12
is.array(x)
13
}
13
}
14
\arguments{
14
\arguments{
15
  \item{data}{a vector giving data to fill the array.}
15
  \item{data}{a vector (including a list) giving data to fill the array.}
16
  \item{dim}{the dim attribute for the array to be created, that is a
16
  \item{dim}{the dim attribute for the array to be created, that is a
17
    vector of length one or more giving the maximal indices in
17
    vector of length one or more giving the maximal indices in
18
    each dimension.}
18
    each dimension.}
19
  \item{dimnames}{the names for the dimensions. This is a list with one
19
  \item{dimnames}{the names for the dimensions. This is a list with one
20
    component for each dimension, either NULL or a character vector of
20
    component for each dimension, either NULL or a character vector of
Line 25... Line 25...
25
\value{
25
\value{
26
  \code{array} returns an array with the extents specified in \code{dim}
26
  \code{array} returns an array with the extents specified in \code{dim}
27
  and naming information in \code{dimnames}.  The values in \code{data} are
27
  and naming information in \code{dimnames}.  The values in \code{data} are
28
  taken to be those in the array with the leftmost subscript moving
28
  taken to be those in the array with the leftmost subscript moving
29
  fastest.  If there are too few elements in \code{data} to fill the array,
29
  fastest.  If there are too few elements in \code{data} to fill the array,
30
  then the elements in \code{data} are recycled.
30
  then the elements in \code{data} are recycled.  If \code{data} has
-
 
31
  length zero, \code{NA} of an appropriate type is used for atomic
-
 
32
  vectors and \code{NULL} for lists.
31
 
33
 
32
  \code{as.array()} coerces its argument to be an array by attaching a
34
  \code{as.array()} coerces its argument to be an array by attaching a
33
  \code{\link{dim}} attribute to it.  It also attaches
35
  \code{\link{dim}} attribute to it.  It also attaches
34
  \code{\link{dimnames}} if \code{x} has \code{\link{names}}.
36
  \code{\link{dimnames}} if \code{x} has \code{\link{names}}.
35
  The sole purpose of this is to make it possible to access the
37
  The sole purpose of this is to make it possible to access the