Skip to content

Commit 0a7db6a

Browse files
committed
More informative message when dropping partners
1 parent f555fc0 commit 0a7db6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

R/partners.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ match_types <- function(x, group="type", partners="", min_datasets=Inf) {
168168
dplyr::ungroup()
169169
todrop <- xg %>%
170170
dplyr::filter(nd<min_datasets)
171-
message("Matching types across datasets. Dropping ",
172-
nrow(todrop), "/", nrow(x),
171+
message("Matching types across datasets. Keeping ",
172+
nrow(x) - nrow(todrop), "/", nrow(x),
173173
" ", substr(partners,1,nchar(partners)-1),
174-
" partner types with total weight ", sum(todrop$weight), "/", sum(x$weight))
174+
" connections with total weight ", sum(x$weight) - sum(todrop$weight), "/", sum(x$weight),
175+
" (", round(1-sum(todrop$weight)/sum(x$weight), digits = 2)*100, "%)"
176+
)
175177
x <- xg %>%
176178
dplyr::filter(nd>=min_datasets) %>%
177179
dplyr::select(-nd)

0 commit comments

Comments
 (0)