nimble (version 0.7.0)

nimble-R-functions: NIMBLE language functions for R-like vector construction

Description

The functions c, rep, seq, which, length, diag, and seq_along can be used in nimbleFunctions and compiled using compileNimble.

Usage

nimC(...)

nimRep(x, ...)

nimSeq(from, to, by, length.out)

Arguments

...

values to be concatenated.

x

vector of values to be replicated (rep) or logical array or vector (which) or object whose length is wanted (length) or input value (diag).

from

starting value of sequence.

to

end value of sequence.

by

increment of the sequence.

length.out

desired length of the sequence.

Details

For c, rep, seq, these functions are NIMBLE's version of similar R functions, e.g., nimRep for rep. In a nimbleFunction, either the R name (e.g., rep) or the NIMBLE name (e.g., nimRep) can be used. If the R name is used, it will be converted to the NIMBLE name. For which, length, diag, seq_along simply use the standard name without "nim". These functions largely mimic (see exceptions below) the behavior of their R counterparts, but they can be compiled in a nimbleFunction using compileNimble.

nimC is NIMBLE's version of c and behaves identically.

nimRep is NIMBLE's version of rep. It should behave identically to rep. There are no NIMBLE versions of rep.int or rep_len.

nimSeq is NIMBLE's version of seq. It behaves like seq with support for from, to, by and length.out arguments. The along.with argument is not supported. There are no NIMBLE versions of seq.int, seq_along or seq_len, with the exception that seq_along can take a nimbleFunctionList as an argument to provide the index range of a for-loop (User Manual Ch. 13).

which behaves like the R version but without support for arr.ind or useNames arguments.

diag behaves like the R version but without support for the nrow and ncol arguments.

length behaves like the R version.

seq_along behaves like the R version.