line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::stat_stddev; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28293
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
203869
|
|
|
1
|
|
|
|
|
11
|
|
4
|
1
|
|
|
1
|
|
371
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
1183
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1299
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
1316
|
use Statistics::Basic; |
|
1
|
|
|
|
|
15151
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub emit_value { |
13
|
2
|
|
|
2
|
0
|
13712
|
my ($self, $var) = @_; |
14
|
2
|
|
|
|
|
9
|
"${var} = Statistics::Basic::stddev(${var}) if is_array_ref(${var});"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Catmandu::Fix::stat_mean - calculate the standard deviation of an array |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Calculate the standard deviation of foo. E.g. foo => [1,2,3,4] |
24
|
|
|
|
|
|
|
stat_stddev(foo) # foo => '1.12' |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SEE ALSO |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
L<Catmandu::Fix> |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |