% if(n_total > 0) { %>
<% if(n_used > 0) { %>
In total there are <%=n_total%> upstream packages. Only <%=n_used%> upstream packages with heaviness on '<%=pkg$package%>' larger than 5 are listed in the following table. Note nine base packages (c("base", "compiler", "datasets", "graphics", "grDevices", "grid", "methods",
"parallel", "splines", "stats", "stats4", "tcltk", "tools", "utils")
) are removed from this table.
<%
el = upstream_dependency(pkg$package)
g = igraph::graph.edgelist(as.matrix(unique(el[, 1:2])))
for(i in seq_len(nrow(upstream_tb))) {
sp = igraph::all_shortest_paths(g, upstream_tb[i, 1], pkg$package)$res
upstream_tb[i, "path"] = paste(sapply(sp, function(x) {
p = names(x)
txt = paste0("", p[1], "")
for(i in seq_len(length(p) - 1)) {
txt = paste0(txt, "", "→
", df[["hv_downstream_values"]][[ p[i] ]][ p[i+1] ], "", p[i+1], "")
}
paste0(txt, "
")
}), collapse = "")
upstream_tb[i, "path_len"] = max(sapply(sp, length))
}
upstream_tb$package = qq("@{upstream_tb$package}", collapse = FALSE)
%>
<%= as.character(knitr::kable(upstream_tb, format = "html", row.names = FALSE, escape = FALSE, col.names = c("Upstream package", "Dependency path", "Dependency depth", qq("Heaviness from upstream on '@{pkg$package}'")), table.attr = "class='table table-striped'")) %>
<% nr = n_used
if(nr > 25) { %>
<%= page_select2(page, ceiling(nr/25), "upstream_dependency", pkg$package) %>
<% } %>
<% } else { %>
In total there are <%=n_total%> upstream dependencied, but no upstream package has heaviness larger than 5 on '<%=pkg$package%>'.
<% } %>
<% } else { %>
No upstream dependency (not including base packages) found.
<% } %>