# NOT RUN {
x <- rray(1:16, c(2, 4, 2), dim_names = list(c("r1", "r2"), NULL, NULL))
# Extract the first row and flatten it
rray_extract(x, 1)
# Extract the first row and first two columns
rray_extract(x, 1, 1:2)
# You can assign directly to these elements
rray_extract(x, 1, 1:2) <- NA
x
# }
Run the code above in your browser using DataLab