set_dimnames_for_rank: Set dimnames() via a standard function call, for a particular...

Description Usage Arguments Details Value See Also Examples

Description

Sets the dimensions names for a particular rank, without requiring dimnames for the other ranks.

Usage

1

Arguments

x

input tidytensor to set dimnames on.

rank

rank to set the dimnames on.

...

dimnames to assign (quoted or unquoted).

.dots

character vector of dimnames to assign (quoted or unquoted).

Details

If all dimnames are unset, they will be set to NA for the other ranks, otherwise they will be left alone.

Value

a tidytensor with dimnames set.

See Also

ranknames<-, dimnames, set_dimnames

Examples

1
2
3
4
t <- as.tidytensor(array(1:(3 * 2), dim = c(3, 2)))
t <- set_dimnames_for_rank(t, 2, valset1, valset2)
t <- set_dimnames_for_rank(t, 2, .dots = c("valset1", "valset2"))
print(t)

oneilsh/tidytensor documentation built on Oct. 11, 2021, 11:43 p.m.