These functions can be used in nimbleFunctions and compiled using compileNimble
.
nimC(...)nimRep(x, ...)
nimSeq(from, to, by, length.out)
values to be concatenated.
vector of values to be replicated (rep
) or logical array or vector (which
) or object whose length is wanted (length
) or input value (diag
).
starting value of sequence.
end value of sequence.
increment of the sequence.
desired length of the sequence.
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
, 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.