微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

R 中 igraph 网络图的高内存使用率

如何解决R 中 igraph 网络图的高内存使用率

我正在使用 R 中的 igraph 构建一个应用程序来绘制相对较大的网络(300 个节点和多达 10,000 个链接)。最终,这个应用程序应该作为 Shiny 应用程序运行,无论是在浏览器中还是作为桌面版本使用电子。

这个问题是绘图函数<nav aria-label="Main Navigation"> <ul> <li class="has-submenu"> <a href="https://example.com/some-category">Some Category</a> <button class="btn-level-1 menu-toggle" type="button" aria-haspopup="true" aria-expanded="false"> <span class="christmas-red"></span> <span class="icon">+</span> <span class="visually-hidden"> <span class="toggleText">show submenu</span> for "Some Category"</span> </button> <ul> <li><a href="https://example.com/some-category/item-1">Some Category Item 1</a></li> <li><a href="https://example.com/some-category/item-2">Some Category Item 2</a></li> </ul> </li> <li class="has-submenu"> <a href="https://example.com/some-category">Another Category</a> <button class="btn-level-1 menu-toggle" type="button" aria-haspopup="true" aria-expanded="false"> <span class="christmas-red"></span> <span class="icon">+</span> <span class="visually-hidden"> <span class="toggleText">show submenu</span> for "Some Category"</span> </button> <ul> <li><a href="https://example.com/another-category/item-1">Some Category Item 1</a></li> <li><a href="https://example.com/another-category/item-2">Some Category Item 2</a></li> </ul> </li> </ul> </nav>使内存猛增1GB。另外,在 RStudio 中清除所有绘图并清除环境或使用 plot(igraphNetwork,...) 不会使 RAM 使用恢复正常。为此,我需要停止当前的 R 会话。

知道内存泄漏在哪里吗? 另外,如何在不使用过多内存的情况下渲染这些网络?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。