# NOT RUN {
# (10, 1) -> (10)
x <- rray(1:10, c(10, 1))
rray_squeeze(x)
# Multiple squeezed dimensions
# (10, 1, 1) -> (10)
y <- rray_reshape(x, c(10, 1, 1))
rray_squeeze(y)
# Use `axes` to specify dimensions to drop
# (10, 1, 1) -> drop 2 -> (10, 1)
rray_squeeze(y, axes = 2)
# Dimension names are kept here
# (10, 1) -> (10)
x <- rray_set_row_names(x, letters[1:10])
rray_squeeze(x)
# And they are kept here
# (1, 10) -> (10)
rray_squeeze(t(x))
# }
Run the code above in your browser using DataLab