diff --git a/NAMESPACE b/NAMESPACE index 9b39347..c7946eb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -42,51 +42,63 @@ export(write_hrc) export(write_hrc2) import(data.table, except = transpose) import(utils) -importFrom(dplyr,"%>%") -importFrom(dplyr,across) -importFrom(dplyr,all_of) -importFrom(dplyr,arrange) -importFrom(dplyr,bind_rows) -importFrom(dplyr,case_when) -importFrom(dplyr,distinct) -importFrom(dplyr,everything) -importFrom(dplyr,filter) -importFrom(dplyr,group_by) -importFrom(dplyr,last_col) -importFrom(dplyr,left_join) -importFrom(dplyr,mutate) -importFrom(dplyr,n) -importFrom(dplyr,n_distinct) -importFrom(dplyr,pull) -importFrom(dplyr,rename) -importFrom(dplyr,rename_with) -importFrom(dplyr,row_number) -importFrom(dplyr,rowwise) -importFrom(dplyr,select) -importFrom(dplyr,summarise) -importFrom(dplyr,tibble) -importFrom(dplyr,ungroup) -importFrom(dplyr,where) -importFrom(igraph,graph_from_data_frame) -importFrom(igraph,which_mutual) -importFrom(lifecycle,badge) -importFrom(lifecycle,deprecated) -importFrom(purrr,compact) -importFrom(purrr,discard) -importFrom(purrr,imap_dfr) -importFrom(purrr,list_c) -importFrom(purrr,map) -importFrom(purrr,map2) -importFrom(purrr,map_at) -importFrom(purrr,transpose) +importFrom(dplyr, + "%>%", + across, + all_of, + arrange, + bind_rows, + case_when, + distinct, + everything, + filter, + group_by, + last_col, + left_join, + mutate, + n, + n_distinct, + pull, + rename, + rename_with, + row_number, + rowwise, + select, + summarise, + tibble, + ungroup, + where +) +importFrom(igraph, + graph_from_data_frame, + which_mutual +) +importFrom(lifecycle, + badge, + deprecated +) +importFrom(purrr, + compact, + discard, + imap_dfr, + list_c, + map, + map2, + map_at, + transpose +) importFrom(rlang,.data) -importFrom(sdcHierarchies,hier_convert) -importFrom(sdcHierarchies,hier_import) +importFrom(sdcHierarchies, + hier_convert, + hier_import +) importFrom(stats,setNames) importFrom(stringr,str_detect) -importFrom(tidyr,nest) -importFrom(tidyr,pivot_longer) -importFrom(tidyr,unnest) -importFrom(tidyr,unnest_wider) +importFrom(tidyr, + nest, + pivot_longer, + unnest, + unnest_wider +) importFrom(utils,combn) importFrom(zoo,na.locf) diff --git a/R/summarize_secret.R b/R/summarize_secret.R index 5a2d83c..133d55d 100644 --- a/R/summarize_secret.R +++ b/R/summarize_secret.R @@ -1,7 +1,7 @@ #' Provide the summary of the suppression pattern from a rtauargus result #' #' @param res_tau either the data.frame resulting from tab_rtauargus run or -#' the list of data.frame resulting from tab_multimanager run +#' the list of data.frame resulting from tab_multi_manager run #' @param var the quantitative variable name to use for values stats of suppression #' (default to `NULL` that is the stats are only computed depending on the number of cells ) #' @param secret_var the name of the variable indicating the primary suppressed cells @@ -77,8 +77,8 @@ summarize_secret <- function(res_tau, var = NULL, secret_var = "is_secret_prim") dplyr::mutate( status = case_when( is_secret_prim ~ "primary suppr.", - final_status_ta != "V" ~ "secondary suppr.", - TRUE ~ "published" + (final_status_ta == "V") | (final_status_ta == FALSE) ~ "published", + TRUE ~ "secondary suppr." )) |> dplyr::mutate(status = factor( status, @@ -118,7 +118,7 @@ summarize_secret <- function(res_tau, var = NULL, secret_var = "is_secret_prim") } - return( purrr::map(res_tau, summarize_secret, var = var) ) + return( purrr::map(res_tau, summarize_secret, var = var, secret_var = secret_var) ) } diff --git a/man/summarize_secret.Rd b/man/summarize_secret.Rd index 876f857..4d038f1 100644 --- a/man/summarize_secret.Rd +++ b/man/summarize_secret.Rd @@ -8,7 +8,7 @@ summarize_secret(res_tau, var = NULL, secret_var = "is_secret_prim") } \arguments{ \item{res_tau}{either the data.frame resulting from tab_rtauargus run or -the list of data.frame resulting from tab_multimanager run} +the list of data.frame resulting from tab_multi_manager run} \item{var}{the quantitative variable name to use for values stats of suppression (default to \code{NULL} that is the stats are only computed depending on the number of cells )}