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/row.Rd
1
% File src/library/base/man/row.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{row}
6
\name{row}
7
\title{Row Indexes}
7
\title{Row Indexes}
8
\alias{row}
8
\alias{row}
Line 16... Line 16...
16
.row(dim)
16
.row(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 row labels (created if necessary)
24
    be returned as a factor of row labels (created if necessary)
25
    rather than as numbers.}
25
    rather than as numbers.}
26
}
26
}
Line 46... Line 46...
46
 
46
 
47
# create an identity 5-by-5 matrix more slowly than diag(n = 5):
47
# create an identity 5-by-5 matrix more slowly than diag(n = 5):
48
x <- matrix(0, nrow = 5, ncol = 5)
48
x <- matrix(0, nrow = 5, ncol = 5)
49
x[row(x) == col(x)] <- 1
49
x[row(x) == col(x)] <- 1
50
x
50
x
-
 
51
 
-
 
52
(i34 <- .row(3:4))
-
 
53
stopifnot(identical(i34, .row(c(3,4)))) # 'dim' maybe "double"
51
}
54
}
52
\keyword{array}
55
\keyword{array}