Skip to content

Commit c25a0c5

Browse files
authored
permfun kwargs was missing, other parameters silently overwritten
Added optional 'permfun' parameter to clusterdepth function.
1 parent e326d13 commit c25a0c5

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/cluster.jl

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,27 @@ function clusterdepth(
2626
rng,
2727
data::AbstractArray;
2828
τ=2.3,
29-
stat_type=:onesample_ttest,
30-
perm_type=:sign,
31-
side_type=:abs,
32-
nperm=5000,
33-
pval_type=:troendle,
34-
(statfun!)=nothing,
35-
statfun=nothing,
29+
stat_type = :onesample_ttest,
30+
perm_type = :sign,
31+
side_type = :abs,
32+
nperm = 5000,
33+
pval_type = :troendle,
34+
(statfun!) = nothing,
35+
statfun = nothing,
36+
permfun = nothing,
3637
)
3738
if stat_type == :onesample_ttest
38-
statfun! = studentt!
39-
statfun = studentt
39+
if isnothing(statfun!)
40+
statfun! = studentt!
41+
end
42+
if isnothing(statfun)
43+
statfun = studentt
44+
end
4045
end
4146
if perm_type == :sign
47+
if isnothing(permfun)
4248
permfun = sign_permute!
49+
end
4350
end
4451
if side_type == :abs
4552
sidefun = abs

0 commit comments

Comments
 (0)