rray_full_like: Create an array like 'x'

Description Usage Arguments Details Value Examples

View source: R/full-like.R

Description

Usage

1
2
3
4
5

Arguments

x

A vector, matrix, array or rray.

value

A value coercible to the same inner type as x that will be used to fill the result (If x is an integer matrix, then value will be coerced to an integer).

Details

No dimension names will be on the result.

Value

An object with the same type as x, but filled with value.

Examples

 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)

rray documentation built on July 23, 2019, 5:04 p.m.