Closed robertogilsaura closed 3 years ago
Hello @robertogilsaura, merry Christmas,
There is a special argument in the tab_sort_desc
: excluded_rows
. It accepts regular expression and rows which match this regular expression won't be sorted. By default it is '#' because we don't need to sort totals. And we can add additional patterns here with |
('or' in regular expression):
df %>%
tab_cells(mrset_f(m_)) %>%
tab_stat_cases() %>%
tab_pivot() %>%
tab_sort_desc(excluded_rows = "#|99")
If you have labels rather than code you need to specify labels: "#|Hard to say|Don\'t know"
it runs properly!!
Thanks.
Hello @gdemin, my best wishes for Christmas and new year. I really hope that 2021 is a better year for everyone.
I have a question about tab_sort()
Is there any way in order to fix 99 in bottom of crosstab? You know, 99 "none of them" or " all of them" or DA or DK in the bottom of table (no sorting missing or special values)
Thanks in advance Regards