Skip to content

Commit

Permalink
More informative message when dropping partners
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Nov 15, 2024
1 parent f555fc0 commit 0a7db6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/partners.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ match_types <- function(x, group="type", partners="", min_datasets=Inf) {
dplyr::ungroup()
todrop <- xg %>%
dplyr::filter(nd<min_datasets)
message("Matching types across datasets. Dropping ",
nrow(todrop), "/", nrow(x),
message("Matching types across datasets. Keeping ",
nrow(x) - nrow(todrop), "/", nrow(x),
" ", substr(partners,1,nchar(partners)-1),
" partner types with total weight ", sum(todrop$weight), "/", sum(x$weight))
" connections with total weight ", sum(x$weight) - sum(todrop$weight), "/", sum(x$weight),
" (", round(1-sum(todrop$weight)/sum(x$weight), digits = 2)*100, "%)"
)
x <- xg %>%
dplyr::filter(nd>=min_datasets) %>%
dplyr::select(-nd)
Expand Down

0 comments on commit 0a7db6a

Please sign in to comment.