Description Usage Arguments Details Value Examples
View source: R/extendr-wrappers.R
Demonstrates passing a raw (byte) vector back and forth between R and Rust, left shifting the values in Rust to prove it works.
1 |
r |
A raw vector to treat as bytes in Rust |
The vector passed to this function must be contain raw values, the
byte type in R. The Rust function signature is
pass_multiple_raws_fn(r: &[u8]) -> Vec<u8>
. R does not support NAs for
raw types. Values should be passed as a raw vector, from as.raw()
.
bitwShiftL(r, 1)
1 | pass_multiple_raws(as.raw(c(2, 4, 8))) # c(4, 8, 16)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.