You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm processing a product test. In this table, I need to hide (not display but compute in %) a category using net
My code...
data <- data.frame(reTEST=c(1,2,1,2,1,2,1,2,1,2,1,2,1,2), value=c(1,5,4,3,2,1,2,1,5,5,1,1,3,5))
data %>%
tab_cols('|'=unvr(reTEST)) %>%
tab_cells('|'=unvr(value)) %>%
tab_net_cells("Top Box (seguro compraría)" = 5,
"Top 2 Box (seguro y probable compraría)"= 4:5,
"Bottom 2 Box (seguro y probable no compraría)"=1:2,
"Rest"=hide(3)) %>%
tab_stat_cpct(total_row_position = 'none') %>%
tab_cells('|'=unvr(value)) %>%
tab_stat_mean() %>%
tab_pivot()
I would need that category "Rest" don't display in table. I think that hide() and unhide() don't build the crosstab like I expect, without category Rest (3).
Is there anyway for this?
Thanks in advance, Gregory.
The text was updated successfully, but these errors were encountered:
Hi, @robertogilsaura hide is for "hiding" items from which category consists. So it is applicable only for "subtotal" and absolutely useless for "nets". "nets" hide subitems by default.
In your case it is easier just remove row:
data %>%
tab_cols('|'=unvr(reTEST)) %>%
tab_cells('|'=unvr(value)) %>%
tab_net_cells("Top Box (seguro compraría)"=5,
"Top 2 Box (seguro y probable compraría)"=4:5,
"Bottom 2 Box (seguro y probable no compraría)"=1:2,
"Rest"=3) %>%
tab_stat_cpct(total_row_position='none') %>%
tab_cells('|'=unvr(value)) %>%
tab_stat_mean() %>%
tab_pivot() %>%
rows(!grepl("Rest", row_labels)) %>%
as.etable()
Hi @gdemin
I'm processing a product test. In this table, I need to hide (not display but compute in %) a category using
net
My code...
I would need that category "Rest" don't display in table. I think that
hide()
andunhide()
don't build the crosstab like I expect, without category Rest (3).Is there anyway for this?
Thanks in advance, Gregory.
The text was updated successfully, but these errors were encountered: