Slices data by one dimension, returning a Matrix.

The following code creates a Cube, slicing and dicing the squad data for a football team by player position and country:

const y = dimension(countries, (country: string) => (player: Player) => player.country === country); // using a user-defined generator

const cube: Matrix<Player> = slice(squad, y);

This is equivalent to pivot with one dimension.