The ppls package contains the normalize.vector function, which does exactly what you want. However, downloading a package doesnβt seem much easier than entering a function line directly ...
The fact that the ppls package implements the function probably means that to achieve this goal there is no standard function R. (Unless, of course, the author of ppls simply did not know about the standard function ...)
Stibu source share