rxExpandGrid {rxode2} | R Documentation |
Faster expand.grid
Description
Only support x and y as characters right now
Usage
rxExpandGrid(x, y, type = 0L)
Arguments
x |
first element (must be character) |
y |
second element (must be character) |
type |
Internal type=0L is traditional expand grid and type=1L is Jacobian expand grid (adds symbols) |
Value
Expand grid
Author(s)
Matthew Fidler
Examples
##
rxExpandGrid(letters, letters)
## Another fast method; See
## https://stackoverflow.com/questions/10405637/use-outer-instead-of-expand-grid
expand.grid.jc <- function(seq1, seq2) {
cbind(
Var1 = rep.int(seq1, length(seq2)),
Var2 = rep.int(seq2, rep.int(length(seq1), length(seq2)))
)
}
microbenchmark::microbenchmark(rxExpandGrid(letters, letters), expand.grid.jc(letters, letters))
[Package rxode2 version 3.0.2 Index]