<% if(n_total > 0) { %>
Dependency plot
<% tmp_file = tempfile(fileext = ".png") if(nrow(rev_tb) > 0) { png(tmp_file, width = 1200*1.5, height = 500*1.5, res = 72*2) l = df$package == pkg$package repo = ifelse(grepl("bioconductor", df$repository), "Bioconductor", "CRAN") color = ifelse(l, "highlight", "others") suppressMessages(suppressWarnings({ p1 = ggplot2::ggplot(df, ggplot2::aes(n_children, heaviness_on_children, pch = repo, color = color, label = ifelse(l, df$package, ""))) + ggplot2::geom_point() + ggplot2::scale_color_manual(values = c("highlight" = "red", "others" = "grey")) + ggplot2::scale_shape_manual(values = c("Bioconductor" = 16, "CRAN" = 4)) + ggplot2::scale_x_continuous(trans='log10') + ggrepel::geom_text_repel(min.segment.length = 0, box.padding = 0.5, max.overlaps = Inf, show.legend = FALSE, size =3) + ggplot2::labs(x = "Number of child packages", y = "Heaviness") + ggplot2::ggtitle("Heaviness on child packages for all CRAN/Bioconductor packages") p2 = ggplot2::ggplot(mapping = ggplot2::aes(all_heaviness)) + geom_histogram() + ggplot2::labs(x = "Heaviness on child packages", y = "Frequency") + ggplot2::ggtitle(qq("Histogram of heaviness of '@{pkg$package}' on its child packages")) print(cowplot::plot_grid(p1, p2, rel_widths = c(1.2, 1))) })) dev.off() } else { png(tmp_file, width = 500*1.5, height = 500*1.5, res = 72*2) l = df$package == pkg$package repo = ifelse(grepl("bioconductor", df$repository), "Bioconductor", "CRAN") color = ifelse(l, "highlight", "others") suppressWarnings({ p1 = ggplot2::ggplot(df, ggplot2::aes(n_children, heaviness_on_children, pch = repo, color = color, label = ifelse(l, df$package, ""))) + ggplot2::geom_point() + ggplot2::scale_color_manual(values = c("highlight" = "red", "others" = "grey")) + ggplot2::scale_shape_manual(values = c("Bioconductor" = 16, "CRAN" = 4)) + ggplot2::scale_x_continuous(trans='log10') + ggrepel::geom_text_repel(min.segment.length = 0, box.padding = 0.5, max.overlaps = Inf, show.legend = FALSE, size =3) + ggplot2::labs(x = "Number of child packages", y = "Heaviness") + ggplot2::ggtitle("Heaviness on child packages for all CRAN/Bioconductor packages") ggplot2:::print.ggplot(p1) }) dev.off() } %> <%= img(tmp_file, style="height:500px")%> <% file.remove(tmp_file) %>
<% if(n_used > 0) { %> <% l = grepl("(bioc|books|annotation|experiment|workflow)", pkg_db_snapshot$meta[rev_tb[, 1], "Repository"]) namespace_link = paste0("https://github.com/cran/", rev_tb[, 1], "/blob/master/NAMESPACE") namespace_link[l] = paste0("https://code.bioconductor.org/browse/", rev_tb[l, 1], "/blob/master/NAMESPACE") l = rev_tb[, 1] %in% BASE_PKGS namespace_link[l] = paste0("https://github.com/wch/r-source/blob/trunk/src/library/", rev_tb[l, 1], "/NAMESPACE") %>

In total, <%=pkg$package%> has <%=n_total%> child packages. Only <%=n_used%> child packages with heaviness from <%=pkg$package%> larger than 10 are listed in the following table.

imports: number of imported functions/objects; importMethods: number of imported S4 methods; importClasses: number of imported S4 classes.

Heaviness of <%=pkg$package%> on child package: number of extra dependency packages that <%=pkg$package%> uniquely imports to.

The full table can be obtained by child_dependency('<%=pkg$package%>').

<% rev_tb$package = qq("@{rev_tb$package}", collapse = FALSE) rev_tb = cbind(rev_tb[, 1:5], "namespace" = qq("link", collapse = FALSE), rev_tb[, 6:7, drop = FALSE]) html_rev_tb = as.character(knitr::kable(rev_tb, format = "html", row.names = FALSE, escape = FALSE, col.names = c("Child package", "Field", "imports", "importMethods", "importClasses", "NAMESPACE file", qq("Heaviness of @{pkg$package} on child package"), "Number of parent packages"), table.attr = "class='table table-striped' id='child-dependency'", align = c("l", rep("r", ncol(rev_tb) - 1)))) html_rev_tb = gsub("(]*?> Reverse Depends \\s+)]*?> 0 \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1The whole set of functions/methods/classes from @{pkg$package} is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse Depends \\s+)]*?> -(\\d+) \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1The whole set of functions/methods/classes from @{pkg$package} excluding \\2 objects is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse Depends \\s+)]*?> -Inf \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1'@{pkg$package}' is listed in Depends of child package but no object from @{pkg$package} is imported.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse Imports \\s+)]*?> 0 \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1The whole set of functions/methods/classes from @{pkg$package} is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse Imports \\s+)]*?> -(\\d+) \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1The whole set of functions/methods/classes from @{pkg$package} excluding \\2 objects is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse Imports \\s+)]*?> -Inf \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1'@{pkg$package}' is listed in Imports of child package but no object from @{pkg$package} is imported.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse LinkingTo \\s+)]*?> 0 \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1The whole set of functions/methods/classes from @{pkg$package} is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse LinkingTo \\s+)]*?> -(\\d+) \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1he whole set of functions/methods/classes from @{pkg$package} excluding \\2 objects is imported to the namespace of child package.\n"), html_rev_tb) html_rev_tb = gsub("(]*?> Reverse LinkingTo \\s+)]*?> -Inf \\s+]*?> 0 \\s+]*?> 0 \\s+", qq("\\1'@{pkg$package}' is listed in LinkingTo of @{pkg$package} but no object from @{pkg$package} is imported.\n"), html_rev_tb) %>
<%= html_rev_tb %>
records per page, showing <%=(page-1)*records_per_page+1%> to <%=min(page*records_per_page, n_used)%> of <%=n_used%> child pacakges.
<% nr = n_used if(nr > records_per_page) { %> <%= page_select2(page, ceiling(nr/records_per_page), "child_dependency", pkg$package, records_per_page, qq("&child_dep_prioritize_reducible=@{child_dep_prioritize_reducible+0}&child_dep_internal_ordering=@{child_dep_internal_ordering+0}")) %> <% } %> <% } else { %>

In total there are <%=n_total%> child dependencies, but no package on which '<%=pkg$package%>' has heaviness larger than 10.

<% } %> <% } else { %>

No child dependency found.

<% } %>