Array operations; created to facilitate the gRain package in 2007. Now largely replaceable by other (often faster) functions implemented in Rcpp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | tablePerm(tab, perm, resize = TRUE, keep.class = FALSE)
tableMult(tab1, tab2)
tableDiv(tab1, tab2)
tableOp(tab1, tab2, op = "*")
tableOp2(tab1, tab2, op = `*`, restore = FALSE)
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)
|
tab, tab1, tab2 |
Arrays with named dimnames. |
perm |
A permutation; either indices or names. |
resize |
A flag indicating whether the vector should be resized as well as having its elements reordered (default TRUE). |
keep.class |
Obsolete argument. |
op |
The operation; choices are |
restore |
Not so clear anymore. |
margin |
Index or name of margin. |
level |
Corresponding level of margin. |
impose |
Value to be imposed. |
mar.idx |
Index of margin |
lev.idx |
Index of level |
complement |
Should values be set for the complement? |
value |
Which value should be set |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.