From e54dd0688953b8202aee867d368f9bfc72566e5f Mon Sep 17 00:00:00 2001 From: PharmCat <13901158+PharmCat@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:43:49 +0300 Subject: [PATCH] fix --- src/descriptive.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/descriptive.jl b/src/descriptive.jl index e8c9627..86d0ceb 100644 --- a/src/descriptive.jl +++ b/src/descriptive.jl @@ -486,14 +486,19 @@ function MetidaBase.metida_table(obj::DataSet{DS}; sort = nothing, stats = nothi union!(resset, Set(keys(obj[i].result))) end end + if !isnothing(stats) stats ⊆ STATLIST || error("Some statistics not known!") if isa(stats, Symbol) stats = [stats] end - if !isnothing(sort) + if isnothing(sort) + ressetl = collect(intersect(resset, stats)) + else ressetl = sortbyvec!(collect(intersect(resset, stats)), sort) end else - if !isnothing(sort) + if isnothing(sort) + ressetl = collect(resset) + else ressetl = sortbyvec!(collect(resset), sort) end end