imager (version 0.45.8)

squeeze: Remove empty dimensions from an array

Description

Works just like Matlab's squeeze function: if anything in dim(x) equals one the corresponding dimension is removed

Usage

squeeze(x)

Arguments

x

an array

Examples

Run this code
cimg.limit.openmp()
A <- array(1:9,c(3,1,3)) #3D array with one flat dimension
A %>% squeeze #flat dimension removed

Run the code above in your browser using DataLab