Converts the elements of an array to a different data type.
Arguments
- x
(
arrayish)
Arrayish value of any data type.- dtype
(
character(1)|DataType)
Target data type.- ambiguous
(
logical(1))
Whether the type is ambiguous. Ambiguous types usually arise from R literals (e.g.,1L,1.0) and follow special promotion rules. See thevignette("type-promotion")for more details.
Value
arrayish
Has the given dtype and the same shape as x.
Ambiguity is controlled by the ambiguous parameter.
StableHLO
Lowers to hlo_convert().