The apply command is used to apply a given function across a given margin of an array or table. For example, to take the sum of a row or column from a two way table, use the apply command with arguments for the table, the sum command, and which dimension to use: