% 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) %>
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%>')
.
Depends
of child package but no object from @{pkg$package} is imported.Imports
of child package but no object from @{pkg$package} is imported.LinkingTo
of @{pkg$package} but no object from @{pkg$package} is imported.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.
<% } %>