api-array-07.Rd
Array operations; created to facilitate the gRain package in 2007. Now largely replaceable by other (often faster) functions implemented in Rcpp.
tablePerm(tab, perm, resize = TRUE, keep.class = FALSE)
tableMult(tab1, tab2)
tableDiv(tab1, tab2)
tableOp(tab1, tab2, op = "*")
tableOp2(tab1, tab2, op = `*`, restore = FALSE)
tableOp0(tab1, tab2, op = `*`)
tableSlice(tab, margin, level, impose)
tableSlicePrim(tab, mar.idx, lev.idx)
tableMargin(tab, margin, keep.class = FALSE)
tableGetSliceIndex(tab, margin, level, complement = FALSE)
tableSetSliceValue(tab, margin, level, complement = FALSE, value = 0)
Arrays with named dimnames.
A permutation; either indices or names.
A flag indicating whether the vector should be resized as well as having its elements reordered (default TRUE).
Obsolete argument.
The operation; choices are "*"
, "/"
, "+"
, "-"
.
Not so clear anymore.
Index or name of margin.
Corresponding level of margin.
Value to be imposed.
Index of margin
Index of level
Should values be set for the complement?
Which value should be set
tableOp0
is brute force implementation based on
dataframes. It is very slow, but useful for error checking.