Skip to content

Let elems argument of rownth() expand to corresponding length if length is 1 #108

@psychelzh

Description

@psychelzh

For example:

set.seed(123)
x <- matrix(rnorm(1000), nrow = 10)
Rfast::rownth(x, 1)
#> [1] -2.809775
# expect this instead:
Rfast::rownth(x, rep(1, nrow(x)))
#>  [1] -2.809775 -2.309169 -1.943651 -1.779977 -2.249051 -2.660923 -2.014210
#>  [8] -2.070751 -2.465898 -2.078489

Created on 2024-04-15 with reprex v2.1.0

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions