`normalize`

projects a vector or matrix onto the
probability simplex.

If all entries (per row or column) get thresholded to
*0* (since they are all negative to start with), then
it sets the position of the maximum of `x`

to
*1* and leaves all other entries at *0*.

1 |

`x` |
a numeric matrix(like object). |

`byrow` |
logical; if |

`tol` |
a tolerance level to set values |

If `x`

is a vector it returns the thresholded vector
(see `threshold`

) and normalized by its sum.
If `x`

is a matrix it works by column of by row
(argument `byrow`

).

1 2 3 4 5 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.