Description Usage Arguments Details Value Examples
rray_full_like()
creates an array with the same type and size as x
, but
filled with value
.
rray_ones_like()
is rray_full_like()
with value = 1
.
rray_zeros_like()
is rray_full_like()
with value = 0
.
1 2 3 4 5 | rray_full_like(x, value)
rray_ones_like(x)
rray_zeros_like(x)
|
x |
A vector, matrix, array or rray. |
value |
A value coercible to the same inner type as |
No dimension names will be on the result.
An object with the same type as x
, but filled with value
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | x <- rray(1:10, c(5, 2))
# Same shape and type as x, but filled with 1
rray_full_like(x, 1L)
# `fill` is coerced to `x` if it can be
rray_full_like(x, FALSE)
# `value = 1`
rray_ones_like(x)
# When logicals are used, it is filled with TRUE
rray_ones_like(c(FALSE, TRUE))
# `value = 0`
rray_zeros_like(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.