The R Project SVN R

Rev

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

Rev 74199 Rev 75324
Line 1... Line 1...
1
% File src/library/base/man/col.Rd
1
% File src/library/base/man/col.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-2017 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{col}
6
\name{col}
7
\title{Column Indexes}
7
\title{Column Indexes}
8
\alias{col}
8
\alias{col}
Line 16... Line 16...
16
.col(dim)
16
.col(dim)
17
}
17
}
18
\arguments{
18
\arguments{
19
  \item{x}{a matrix-like object, that is one with a two-dimensional
19
  \item{x}{a matrix-like object, that is one with a two-dimensional
20
    \code{dim}.}
20
    \code{dim}.}
21
  \item{dim}{a matrix dimension, i.e., \code{\link{integer}} vector of
21
  \item{dim}{a matrix dimension, i.e., an integer valued numeric vector of
22
    length two (with non-negative entries).}
22
    length two (with non-negative entries).}
23
  \item{as.factor}{a logical value indicating whether the value should
23
  \item{as.factor}{a logical value indicating whether the value should
24
    be returned as a factor of column labels (created if necessary)
24
    be returned as a factor of column labels (created if necessary)
25
    rather than as numbers.}
25
    rather than as numbers.}
26
}
26
}
Line 44... Line 44...
44
ma[row(ma) == col(ma) + 1]
44
ma[row(ma) == col(ma) + 1]
45
 
45
 
46
# create an identity 5-by-5 matrix more slowly than diag(n = 5):
46
# create an identity 5-by-5 matrix more slowly than diag(n = 5):
47
x <- matrix(0, nrow = 5, ncol = 5)
47
x <- matrix(0, nrow = 5, ncol = 5)
48
x[row(x) == col(x)] <- 1
48
x[row(x) == col(x)] <- 1
-
 
49
 
-
 
50
(i34 <- .col(3:4))
-
 
51
stopifnot(identical(i34, .col(c(3,4)))) # 'dim' maybe "double"
49
}
52
}
50
\keyword{array}
53
\keyword{array}