List-Vectorize
view release on metacpan or search on metacpan
lib/List/Vectorize.pm view on Meta::CPAN
=item C<table(ARRAY_REF, ARRAY_REF, ...)>
The same as C<freq>, to be consist with R
=item C<scale(ARRAY_REF, SCALAR)>
Scale the vector based on some criterion.
zvalue vector has mean value of 0 and variance of 1 (by default)
formula: (x-mean)/sd
percentage values in the vector are between 0 - 1
formula: (x-min)/(max-min)
sphere format the n-dimensional point on the surface of the unit super sphere
formula: x/radius
=item C<sample(ARRAY_REF, SCALAR (size), HASH)>
Random samplings and permutations. The third argument is
p probability for each sampling, values will be scaled into [0, 1]
replace whether sampling with replacement. 1|0
my $x = ["a".."g"];
# sample without replacement
( run in 0.524 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )