├── .DS_Store ├── .Rbuildignore ├── .Rproj.user ├── 9D26539C │ ├── cpp-complilation-config │ ├── cpp-definition-cache │ ├── persistent-state │ ├── rmd-outputs │ ├── saved_source_markers │ └── sources │ │ └── prop │ │ ├── 1F0FB9E8 │ │ ├── 3243B860 │ │ ├── 341014FB │ │ ├── 342154CD │ │ ├── 4974D61A │ │ ├── 5050EC88 │ │ ├── 54F8125 │ │ ├── 5678EFA2 │ │ ├── 58D48974 │ │ ├── 5C5710FA │ │ ├── 6187F40D │ │ ├── 6D742645 │ │ ├── 723C18B2 │ │ ├── 72EF8F5C │ │ ├── 77E5BF1D │ │ ├── 78E928BF │ │ ├── 7D962 │ │ ├── 820DDCC1 │ │ ├── 86F366CF │ │ ├── 948DEC87 │ │ ├── 9713A03A │ │ ├── B0AB6A00 │ │ ├── BD293688 │ │ ├── BEE45D7B │ │ ├── DB5503AB │ │ ├── E0F10002 │ │ ├── EDEB5E85 │ │ ├── F097D29D │ │ ├── FC020CE │ │ └── INDEX └── shared │ └── notebooks │ ├── patch-chunk-names │ └── paths ├── .gitattributes ├── .gitignore ├── DESCRIPTION ├── Infomap ├── Infomap.zip ├── NAMESPACE ├── R ├── .DS_Store ├── NMI.R ├── check_infomap.R ├── create_infomap_linklist.R ├── gg_color_hue.R ├── infomapecology.R ├── install_infomap.R ├── kongsfjorden_links-data.R ├── kongsfjorden_nodes-data.R ├── otago_links-data.R ├── otago_nodes-data.R ├── plot_modular_matrix.R ├── plot_multilayer_alluvial.R ├── plot_multilayer_modules.R ├── plot_signif.R ├── run_infomap_monolayer.R ├── run_infomap_multilayer.R ├── shuffle_infomap.R ├── siberia1982_matrix.R ├── siberia1983_matrix.R ├── siberia1984_matrix.R ├── siberia1985_matrix.R ├── siberia1986_matrix.R ├── siberia1987_matrix.R ├── siberia_interlayer.R ├── siberia_nodes.R └── tur2016-data.R ├── README.md ├── code_from_paper ├── .DS_Store ├── gillaranz.csv ├── hierarcical_structure_ex_kongsfjord.R ├── infomap_ecology_main.R └── infomap_vs_Q.R ├── data ├── .DS_Store ├── kongsfjorden_links.RData ├── kongsfjorden_nodes.RData ├── otago_links.RData ├── otago_nodes.RData ├── siberia1982_7_links.rda ├── siberia1982_7_nodes.rda ├── siberia1982_matrix.rda ├── siberia1983_matrix.rda ├── siberia1984_matrix.rda ├── siberia1985_matrix.rda ├── siberia1986_matrix.rda ├── siberia1987_matrix.rda ├── siberia_interlayer.rda ├── siberia_nodes.rda └── tur2016.RData ├── docs ├── Infomap ├── about.html ├── bipartite.html ├── bipartite_files │ └── figure-html │ │ └── Bipartite_1-1.png ├── ecomplab.png ├── flows.html ├── hypothesis_test.html ├── hypothesis_test_files │ └── figure-html │ │ ├── hypothesis_1-1.png │ │ ├── hypothesis_1-2.png │ │ ├── hypothesis_2-1.png │ │ ├── hypothesis_4-1.png │ │ └── hypothesis_4-2.png ├── index.html ├── installation.html ├── logos.png ├── logos_6.png ├── logos_new31.jpg ├── monolayer_heirarchical.html ├── monolayer_heirarchical_files │ └── figure-html │ │ ├── monolayer_heirarchical_2-1.png │ │ └── monolayer_heirarchical_2-2.png ├── monolayer_node_attributes.html ├── monolayer_node_attributes_files │ └── figure-html │ │ └── monolayer_node_attribut_2-1.png ├── multilayer_interlayer_emln.html ├── multilayer_interlayer_emln_files │ └── figure-html │ │ ├── multilayer_inter_2-1.png │ │ └── multilayer_inter_2-2.png ├── multilayer_relax_emln.html ├── multilayer_relax_emln_files │ └── figure-html │ │ └── multilayer_emln_3-1.png ├── otago_node_attributes.txt └── site_libs │ ├── bootstrap-3.3.5 │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── cerulean.min.css │ │ ├── cosmo.min.css │ │ ├── darkly.min.css │ │ ├── flatly.min.css │ │ ├── fonts │ │ │ ├── Lato.ttf │ │ │ ├── LatoBold.ttf │ │ │ ├── LatoItalic.ttf │ │ │ ├── NewsCycle.ttf │ │ │ ├── NewsCycleBold.ttf │ │ │ ├── OpenSans.ttf │ │ │ ├── OpenSansBold.ttf │ │ │ ├── OpenSansBoldItalic.ttf │ │ │ ├── OpenSansItalic.ttf │ │ │ ├── OpenSansLight.ttf │ │ │ ├── OpenSansLightItalic.ttf │ │ │ ├── Raleway.ttf │ │ │ ├── RalewayBold.ttf │ │ │ ├── Roboto.ttf │ │ │ ├── RobotoBold.ttf │ │ │ ├── RobotoLight.ttf │ │ │ ├── RobotoMedium.ttf │ │ │ ├── SourceSansPro.ttf │ │ │ ├── SourceSansProBold.ttf │ │ │ ├── SourceSansProItalic.ttf │ │ │ ├── SourceSansProLight.ttf │ │ │ └── Ubuntu.ttf │ │ ├── journal.min.css │ │ ├── lumen.min.css │ │ ├── paper.min.css │ │ ├── readable.min.css │ │ ├── sandstone.min.css │ │ ├── simplex.min.css │ │ ├── spacelab.min.css │ │ ├── united.min.css │ │ └── yeti.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ └── shim │ │ ├── html5shiv.min.js │ │ └── respond.min.js │ ├── clipboard-1.7.1 │ └── clipboard.min.js │ ├── header-attrs-2.20 │ └── header-attrs.js │ ├── highlightjs-9.12.0 │ ├── default.css │ ├── highlight.js │ └── textmate.css │ ├── jquery-3.6.0 │ ├── jquery-3.6.0.js │ ├── jquery-3.6.0.min.js │ └── jquery-3.6.0.min.map │ ├── jqueryui-1.11.4 │ ├── README │ ├── images │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_555555_256x240.png │ │ ├── ui-icons_777620_256x240.png │ │ ├── ui-icons_777777_256x240.png │ │ ├── ui-icons_cc0000_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ ├── index.html │ ├── jquery-ui.css │ ├── jquery-ui.js │ ├── jquery-ui.min.css │ ├── jquery-ui.min.js │ ├── jquery-ui.structure.css │ ├── jquery-ui.structure.min.css │ ├── jquery-ui.theme.css │ └── jquery-ui.theme.min.css │ ├── klippy-0.0.0.9500 │ ├── css │ │ └── klippy.min.css │ └── js │ │ └── klippy.min.js │ ├── navigation-1.1 │ ├── codefolding-lua.css │ ├── codefolding.js │ ├── sourceembed.js │ └── tabsets.js │ ├── primer-tooltips-1.4.0 │ └── build.css │ └── tocify-1.9.1 │ ├── jquery.tocify.css │ └── jquery.tocify.js ├── docs_old ├── _config.yml ├── bipartite.md ├── flows.md ├── hypothesis_test.md ├── index.md ├── infomapbasics.md ├── installation.md ├── monolayer_heirarchical.md ├── monolayer_node_attributes.md ├── multilayer_interlayer.md └── multilayer_relax.md ├── infomap_ecology_package.Rproj ├── man ├── .DS_Store ├── NMI.Rd ├── check_infomap.Rd ├── create_infomap_linklist.Rd ├── gg_color_hue.Rd ├── infomap_link_list.Rd ├── infomap_monolayer.Rd ├── infomap_multilayer.Rd ├── infomapecology.Rd ├── install_infomap.Rd ├── kongsfjorden_links.Rd ├── kongsfjorden_nodes.Rd ├── otago_links.Rd ├── otago_nodes.Rd ├── plot_modular_matrix.Rd ├── plot_multilayer_alluvial.Rd ├── plot_multilayer_modules.Rd ├── plot_signif.Rd ├── run_infomap_monolayer.Rd ├── run_infomap_multilayer.Rd ├── shuffle_infomap.Rd ├── siberia1982_matrix.Rd ├── siberia1983_matrix.Rd ├── siberia1984_matrix.Rd ├── siberia1985_matrix.Rd ├── siberia1986_matrix.Rd ├── siberia1987_matrix.Rd ├── siberia_interlayer.Rd ├── siberia_nodes.Rd └── tur2016.Rd ├── multilayer_example.csv ├── readme badges.R └── website_source ├── .DS_Store ├── Infomap ├── _site.yml ├── about.Rmd ├── bipartite.Rmd ├── ecomplab.png ├── flows.Rmd ├── hypothesis_test.Rmd ├── index.Rmd ├── installation.Rmd ├── logos.png ├── logos_6.png ├── logos_new31.jpg ├── make_site.R ├── monolayer_heirarchical.Rmd ├── monolayer_node_attributes.Rmd ├── multilayer_interlayer_emln.Rmd ├── multilayer_relax_emln.Rmd └── otago_node_attributes.txt /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/.DS_Store -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | docs/ 4 | code_from_paper/ 5 | ^Infomap 6 | ^mylist.txt$ -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/cpp-complilation-config: -------------------------------------------------------------------------------- 1 | { 2 | "args" : [ 3 | "-isystem", 4 | "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include", 5 | "-I/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include", 6 | "-I/usr/local/include", 7 | "-I/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1", 8 | "-I/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include", 9 | "-I/Library/Developer/CommandLineTools/usr/include", 10 | "-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include", 11 | "-I/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include", 12 | "-I/Library/Frameworks/R.framework/Resources/include", 13 | "-DNDEBUG", 14 | "-I/usr/local/include", 15 | "-std=c++14", 16 | "-fPIC" 17 | ], 18 | "hash" : "15839508741583955917", 19 | "is_cpp" : true, 20 | "pch" : "Rcpp" 21 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/persistent-state: -------------------------------------------------------------------------------- 1 | build-last-errors="[]" 2 | build-last-errors-base-dir="~/GitHub/infomap_ecology_package/" 3 | build-last-outputs="[{\"output\":\"==> R CMD INSTALL --no-multiarch --with-keep.source infomap_ecology_package\\n\\n\",\"type\":0},{\"output\":\"* installing to library ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library’\\n\",\"type\":1},{\"output\":\"* installing *source* package ‘infomapecology’ ...\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** using staged installation\\n\",\"type\":1},{\"output\":\"** R\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** data\\n\",\"type\":1},{\"output\":\"*** moving datasets to lazyload DB\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** byte-compile and prepare package for lazy loading\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** building package indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded from temporary location\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded from final location\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package keeps a record of temporary installation path\\n\",\"type\":1},{\"output\":\"* DONE (infomapecology)\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]" 4 | compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}" 5 | files.monitored-path="" 6 | find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":true,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}" 7 | imageDirtyState="1" 8 | saveActionState="-1" 9 | -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/rmd-outputs: -------------------------------------------------------------------------------- 1 | ~/GitHub/COVID19.html 2 | ~/GitHub/COVID19.html 3 | ~/GitHub/COVID19.html 4 | ~/GitHub/COVID19.html 5 | ~/GitHub/COVID19.html 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/1F0FB9E8: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "6,22", 3 | "scrollLine" : "18" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/3243B860: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "156,2", 3 | "scrollLine" : "149" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/341014FB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "5,47", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/342154CD: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "1,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/4974D61A: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "21,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/5050EC88: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "15,18", 3 | "scrollLine" : "9", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/54F8125: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "12,2", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/5678EFA2: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "79,0", 3 | "docOutlineVisible" : "1", 4 | "scrollLine" : "40" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/58D48974: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "10,0", 3 | "docOutlineVisible" : "1", 4 | "scrollLine" : "0" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/5C5710FA: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "14,20", 3 | "scrollLine" : "5", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/6187F40D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "7,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/6D742645: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "33,18", 3 | "scrollLine" : "26" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/723C18B2: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "1,0", 3 | "scrollLine" : "9" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/72EF8F5C: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "1,2", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled3" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/77E5BF1D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "11,12", 3 | "scrollLine" : "2" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/78E928BF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "16,181", 3 | "scrollLine" : "9", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/7D962: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "21,10", 3 | "scrollLine" : "23" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/820DDCC1: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "7,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/86F366CF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "57,51", 3 | "scrollLine" : "50" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/948DEC87: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "1,0", 3 | "scrollLine" : "1" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/9713A03A: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "5,35", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/B0AB6A00: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "8,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled3" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/BD293688: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "6,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/BEE45D7B: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "2,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/DB5503AB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "12,49", 3 | "scrollLine" : "3" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/E0F10002: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "1,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/EDEB5E85: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "3,16", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/F097D29D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "96,11", 3 | "scrollLine" : "40" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/9D26539C/sources/prop/FC020CE: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "233,4", 3 | "docOutlineSize" : "204.78471868959375", 4 | "docOutlineVisible" : "0", 5 | "scrollLine" : "224" 6 | } -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/patch-chunk-names: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/.Rproj.user/shared/notebooks/patch-chunk-names -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/paths: -------------------------------------------------------------------------------- 1 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/NAMESPACE="EBFAB2EB" 2 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1982_matrix.R="B6FD0BDD" 3 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1983_matrix.R="00E7E450" 4 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1984_matrix.R="42016468" 5 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1985_matrix.R="865D9440" 6 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1986_matrix.R="4A126954" 7 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia1987_matrix.R="27AE7ABB" 8 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia_interlayer.R="E1C4984D" 9 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/R/siberia_nodes.R="8B13F478" 10 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/website_source/about.Rmd="D70FC43F" 11 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/website_source/index.Rmd="7F29E0B9" 12 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/website_source/installation.Rmd="91CF2235" 13 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/website_source/multilayer_interlayer_emln.Rmd="3E514A82" 14 | /Users/shirlyf/Documents/GitHub/infomap_ecology_package/website_source/multilayer_relax_emln.Rmd="393F16C2" 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | src/*.o 6 | src/*.so 7 | src/*.dll 8 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: infomapecology 2 | Type: Package 3 | Title: Community Detection using Infomap, Inspired by Ecological Networks 4 | Version: 2.0 5 | URL: https://github.com/Ecological-Complexity-Lab/infomap_ecology_package 6 | Date: 2023-11-22 7 | Author: Shai Pilosof 8 | Maintainer: Shirly Freilikhman , Shai Pilosof 9 | BugReports: https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues 10 | Description: Collection of R functions to perform community detection analysis with Infomap. Also includes standardized objects to store and further analyze monolayer and multilayer networks. Inspired by ecological networks but can work for other networks too! Ideas/requests for features are welcome (open an issue here: https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues). This work was supported by research grant ISF (Israel Science Foundation) 1281/20 to Shai Pilosof 11 | License: GPL 12 | Encoding: UTF-8 13 | LazyData: true 14 | Depends: 15 | R (>= 4.1.0), 16 | attempt, 17 | cowplot, 18 | ggalluvial, 19 | magrittr, 20 | dplyr, 21 | readr, 22 | ggplot2, 23 | stringr, 24 | tibble, 25 | tidyr, 26 | rlang, 27 | igraph, 28 | vegan, 29 | emln 30 | Suggests: 31 | bipartite 32 | RoxygenNote: 7.2.3 33 | Comment: Some functions are wrappers for the standalone file Infomap (independently installed) and their examples are set to "dontrun". Competibal only with Infomap version >=2.0.0. 34 | -------------------------------------------------------------------------------- /Infomap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/Infomap -------------------------------------------------------------------------------- /Infomap.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/Infomap.zip -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export() 4 | export(NMI) 5 | export(check_infomap) 6 | export(create_infomap_linklist) 7 | export(install_infomap) 8 | export(plot_modular_matrix) 9 | export(plot_multilayer_alluvial) 10 | export(plot_multilayer_modules) 11 | export(plot_signif) 12 | export(run_infomap_monolayer) 13 | export(run_infomap_multilayer) 14 | export(shuffle_infomap) 15 | importFrom(dplyr,left_join) 16 | importFrom(dplyr,select) 17 | importFrom(igraph,graph.incidence) 18 | importFrom(magrittr,'%<>%') 19 | importFrom(magrittr,'%>%') 20 | importFrom(stats,simulate) 21 | importFrom(vegan,commsim) 22 | importFrom(vegan,nullmodel) 23 | -------------------------------------------------------------------------------- /R/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/R/.DS_Store -------------------------------------------------------------------------------- /R/NMI.R: -------------------------------------------------------------------------------- 1 | #' Normalized mutual information 2 | #' 3 | #' Calculate normalized mutual information based on a confusion matrix. Very 4 | #' useful for comparing between two partition structures of a network. 5 | #' 6 | #' @param N A confusion matrix. 7 | #' 8 | #' @return Value between 0 (no mutual information) to 1 (complete mutual 9 | #' information). 10 | #' 11 | #' @details If the partitions are exactly the same then all the nodes that 12 | #' appear in a given module in the first network will also appear in the same 13 | #' module in the second network. In this case, the confusion matrix will have 14 | #' all the values on the diagonal, and NMI=1. 15 | #' 16 | #' @references Danon L, Díaz-Guilera A, Duch J, Arenas A. Comparing community 17 | #' structure identification. J Stat Mech. 2005;2005: P09008. 18 | #' @references Guimerà R, Sales-Pardo M, Amaral LAN. Module identification in 19 | #' bipartite and directed networks. Phys Rev E Stat Nonlin Soft Matter Phys. 20 | #' 2007;76: 036102. 21 | #' @references Pilosof S, Fortuna MA, Cosson J-FC, Galan M, Kittipong C, Ribas 22 | #' A, et al. Host-parasite network structure is associated with 23 | #' community-level immunogenetic diversity. Nat Commun. 2014;5: 5172. 24 | #' 25 | #' @examples 26 | #' # Generate a confusion martrix for a network with 50 modules. 27 | #' # Partition A has 6 modules (rows), partition B has 5 (columns). 28 | #' # Each cell in N indicates the number of nodes that were assigned 29 | #' # together to a module in A and B. For example, 5 nodes were assigned 30 | #' # to module 2 in partition A and to module 1 in partition B. 31 | #' N <- matrix(0,6,5) 32 | #' diag(N[-1,])<-c(5,2,6,5,5) 33 | #' diag(N) <- c(4,4,6,5,5) 34 | #' N[6,1] <- 2 35 | #' N[1,4] <- 1 36 | #' NMI(N) 37 | #' 38 | #' # An example of perfect information (exact same partitions): 39 | #' N <- matrix(0,5,5) 40 | #' diag(N) <- c(10,15,10,12,3) 41 | #' NMI(N) # Should be 1 42 | #' 43 | #' @export 44 | NMI <- function (N) { 45 | S <- sum(N) 46 | CA = dim(N)[1]; CB = dim(N)[2] 47 | Iup=0 48 | for (i in 1:CA){ 49 | for (j in 1:CB){ 50 | if (N[i,j] != 0){ 51 | Ni.=sum(N[i,]) 52 | N.j=sum(N[,j]) 53 | Iup = Iup+N[i,j]*log((N[i,j]*S)/(Ni.*N.j)) 54 | } 55 | } 56 | } 57 | Idown1=0;Idown2=0 58 | for (i in 1:CA){ 59 | Ni.=sum(N[i,]) 60 | Idown1=Idown1+Ni.*log(Ni./S) 61 | } 62 | for (j in 1:CB){ 63 | N.j=sum(N[,j]) 64 | Idown2=Idown2+N.j*log(N.j/S) 65 | } 66 | I=-2*Iup/(Idown1+Idown2) 67 | 68 | return(I) 69 | } 70 | -------------------------------------------------------------------------------- /R/check_infomap.R: -------------------------------------------------------------------------------- 1 | #' Check if Infomap's standalone file is installed. 2 | #' 3 | #' Attempts to run Infomap via the \code{system} command to make sure it works propoerly. 4 | #' 5 | #' @return FALSE and an error if Infomap is not installed correctly. TRUE (and version number) if it is. 6 | #' 7 | #' @examples 8 | #' check_infomap() 9 | #' 10 | #' @param x The name of the Infomap executable file. 11 | #' @details For now, this package depends on Infomap's stand-alone version. Futre versions or another package will incorporate Infomap directly into R. 12 | #' 13 | #' @export 14 | 15 | check_infomap <- function(x='Infomap'){ 16 | out <- attempt(system(paste('./',x,' -V',sep='')), msg = 'Infomap not installed correctly. See www.mapequation.org for instructions on how to install.') 17 | if (out==0) { 18 | return(T) 19 | } else { 20 | return(F) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /R/create_infomap_linklist.R: -------------------------------------------------------------------------------- 1 | #' Create a link list for Infomap 2 | #' 3 | #' Takes a monolayer object and returns a link list and a tibble with nodes. 4 | #' 5 | #' @param x A monolayer object created with \code{create_monolayer_network}. 6 | #' @param make_directed for undirected networks, create two sets of edges. 7 | #' @param write_to_file write the link list into a file? 8 | #' @param output_file the name of the output file (default is 'infomap_link_list.txt') 9 | #' 10 | #' @details Used internally by \code{run_infomap_monolayer}, but also useful for writing the link list to a file. 11 | #' 12 | #' @return An object of class \code{infomap_link_list}, which is an R list with: 13 | #' \itemize{ 14 | #' \item \code{edge_list_infomap} A link list (format: from, to, weight) formatted for Infomap, with node IDs 15 | #' \item \code{nodes} A tibble with node IDs, names and possibly other attributes. 16 | #' } 17 | #' 18 | #' @seealso 19 | #' \code{infomap_link_list} 20 | #' 21 | #' @examples 22 | #' network_object <- create_monolayer_network(bipartite::memmott1999, 23 | #' bipartite = TRUE, directed = FALSE, group_names = c('A','P')) 24 | #' 25 | #' x <- create_infomap_linklist(network_object, make_directed = FALSE, 26 | #' write_to_file = FALSE) 27 | #' 28 | #' @export 29 | #' 30 | ## @import dplyr 31 | ## @import magrittr 32 | 33 | create_infomap_linklist <- function(x, make_directed=F, write_to_file=F, output_file='infomap_link_list.txt'){ 34 | if(class(x)!='monolayer'){stop('x must be of class monolayer')} 35 | # prepare an edge list for infomap. 36 | edge_list <- x$edge_list 37 | names(edge_list)[1:2] <- c('from','to') 38 | nodes <- x$nodes 39 | edge_list %<>% 40 | left_join(nodes, by=c('from' = 'node_name')) %>% 41 | left_join(nodes, by=c('to' = 'node_name')) %>% 42 | select(from=node_id.x, to=node_id.y, weight) 43 | if(write_to_file){ 44 | print(paste('Link list written to: ',output_file,sep='')) 45 | write_delim(edge_list, output_file, delim = ' ', col_names = F) 46 | } 47 | out <- list(edge_list_infomap=edge_list, nodes=nodes) 48 | class(out) <- 'infomap_link_list' 49 | return(out) 50 | } 51 | -------------------------------------------------------------------------------- /R/gg_color_hue.R: -------------------------------------------------------------------------------- 1 | #' Generate colors for ggplot 2 | #' @param n See package metafolio 3 | #' @param hue_min See package metafolio 4 | #' @param hue_max See package metafolio 5 | #' @param tune1 See package metafolio 6 | #' @param tune2 See package metafolio 7 | #' 8 | #' @details Taken from package metafolio. See details there 9 | 10 | gg_color_hue <- function(n, hue_min = 10, hue_max = 280, tune1 = 62, tune2 = 100) { 11 | hues = seq(hue_min, hue_max, length=n+1) 12 | hcl(h=hues, l=tune1, c=tune2)[1:n] 13 | } -------------------------------------------------------------------------------- /R/infomapecology.R: -------------------------------------------------------------------------------- 1 | #'infomapecology: A package for running Infomap, inspired by ecological networks 2 | #' 3 | #'The package contains functions that prepare monolayer and multilayer networks 4 | #'for analysis with Infomap, run Infomap from within R and parse the results 5 | #'back to R. Also includes standardized objects to store and further analyze 6 | #'monolayer and multilayer networks. The package is inspired by analysis of 7 | #'ecological networks but is suitable for other areas of research as well. 8 | #' 9 | #'We use Infomap as a stand-alone file. Future versions will integrate Infomap 10 | #'directly into R. Complete instructions on how to download, install and use 11 | #'Infomap can be found in 12 | #'\href{https://www.mapequation.org}{https://www.mapequation.org}. The best 13 | #'practice is to compile Infomap under the file name Infomap and place it in the 14 | #'same working folder in which the R code is run. See details in \href{https://ecological-complexity-lab.github.io/infomap_ecology_package/installation}{https://ecological-complexity-lab.github.io/infomap_ecology_package/installation} 15 | #' 16 | #'The package also includes several data sets of ecological networks. 17 | #' 18 | #'Ideas/requests for features are welcome (open an issue 19 | #'\href{https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues}{https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues}). 20 | #' 21 | #'@docType package 22 | #'@name infomapecology 23 | #' 24 | #'@author Shai Pilosof 25 | #' 26 | #'@references Farage C, Edler D, Eklöf A, Rosvall M, Pilosof S. Identifying flow 27 | #' modules in ecological networks using Infomap. Methods in Ecology and 28 | #' Evolution 2021. doi:10.1111/2041‐210X.13569 29 | #' 30 | NULL 31 | -------------------------------------------------------------------------------- /R/kongsfjorden_links-data.R: -------------------------------------------------------------------------------- 1 | #' Kongsfjorden food web: links 2 | #' 3 | #' Food web including metazoan parasites for an intertidal ecosystem in New 4 | #' Zealand. 5 | #' 6 | #' @details The data set is included here "as is". In this network, nodes are 7 | #' species or taxonomical groups (e.g., Phytoplankton) and binary links 8 | #' represent feeding relationships. Kongsfjorden is a glacial fjord on the 9 | #' northwest corner of the Svalbard archipelago. It is a 30 km open fjord with 10 | #' no marked sill at the entrance, and with a maximum depth exceeding 300 m. 11 | #' The network consists of 262 species with 1,544 feeding interactions. 12 | #' 13 | #' @docType data 14 | #' 15 | #' @usage data(kongsfjorden_links) 16 | #' 17 | #' @keywords datasets 18 | #' 19 | #' @references 20 | #' Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223. 21 | #' 22 | #'Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884. 23 | #' 24 | #' @seealso \code{kongsfjorden_nodes} 25 | #' @examples 26 | #' data(kongsfjorden_links) 27 | "kongsfjorden_links" 28 | -------------------------------------------------------------------------------- /R/kongsfjorden_nodes-data.R: -------------------------------------------------------------------------------- 1 | #' Kongsfjorden food web: nodes 2 | #' 3 | #' Food web including metazoan parasites for an intertidal ecosystem in New 4 | #' Zealand. 5 | #' 6 | #' @details The data set is included here "as is". In this network, nodes are 7 | #' species or taxonomical groups (e.g., Phytoplankton) and binary links 8 | #' represent feeding relationships. Kongsfjorden is a glacial fjord on the 9 | #' northwest corner of the Svalbard archipelago. It is a 30 km open fjord with 10 | #' no marked sill at the entrance, and with a maximum depth exceeding 300 m. 11 | #' The network consists of 262 species with 1,544 feeding interactions. 12 | #' 13 | #' @docType data 14 | #' 15 | #' @usage data(kongsfjorden_nodes) 16 | #' 17 | #' @keywords datasets 18 | #' 19 | #' @references 20 | #' Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223. 21 | #' 22 | #'Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884. 23 | #' 24 | #' @seealso \code{kongsfjorden_links} 25 | #' @examples 26 | #' data(kongsfjorden_nodes) 27 | "kongsfjorden_nodes" 28 | -------------------------------------------------------------------------------- /R/otago_links-data.R: -------------------------------------------------------------------------------- 1 | #' Otago food web: links 2 | #' 3 | #' Food web including metazoan parasites for an intertidal ecosystem in New Zealand. 4 | #' 5 | #' @details The data set is included here "as is". It contains metadata on nodes (see \code{otago_nodes}). 6 | #' The links between nodes are directed and binary. 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(otago_links) 11 | #' 12 | #' @keywords datasets 13 | #' 14 | #' @references Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for an intertidal ecosystem in New Zealand: Ecological Archives E092-173. Ecology. 2011;92: 2006–2006. 15 | #' 16 | #' (\href{https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/11-0371.1}{Link to paper}) 17 | #' 18 | #' @source \href{https://figshare.com/collections/Food_web_including_metazoan_parasites_for_an_intertidal_ecosystem_in_New_Zealand/3304212}{Original data set on Figshare.} 19 | #' 20 | #' @seealso \code{otago_nodes} 21 | #' @examples 22 | #' data(otago_links) 23 | "otago_links" 24 | -------------------------------------------------------------------------------- /R/otago_nodes-data.R: -------------------------------------------------------------------------------- 1 | #' Otago food web: nodes 2 | #' 3 | #' Food web including metazoan parasites for an intertidal ecosystem in New 4 | #' Zealand. 5 | #' 6 | #' @details The data set is included here "as is". This data set contains all the node attributes (metadata). 7 | #' The links between nodes. Links are in \code{otago_links} 8 | #' 9 | #' @docType data 10 | #' 11 | #' @usage data(otago_nodes) 12 | #' 13 | #' @keywords datasets 14 | #' 15 | #' @references Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web 16 | #' including metazoan parasites for an intertidal ecosystem in New Zealand: 17 | #' Ecological Archives E092-173. Ecology. 2011;92: 2006–2006. 18 | #' 19 | #' (\href{https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/11-0371.1}{Link to paper}) 20 | #' 21 | #' @source \href{https://figshare.com/collections/Food_web_including_metazoan_parasites_for_an_intertidal_ecosystem_in_New_Zealand/3304212}{Original data set on Figshare.} 22 | #' 23 | #' @seealso \code{otago_links} 24 | #' @examples 25 | #' data(otago_nodes) 26 | "otago_nodes" 27 | -------------------------------------------------------------------------------- /R/plot_modular_matrix.R: -------------------------------------------------------------------------------- 1 | #' Plot a matrix with colored interactions by modules 2 | #' 3 | #' @param x An object of class \code{infomap_monolayer}. 4 | #' @param fix_coordinates Should x and y coordinates be fixed by ggplot to 5 | #' create square cells. 6 | #' @param transpose Option to transpose the matrix. Useful for matrices with 7 | #' very differnt numbers of rows and columns. 8 | #' @param outside_module_col Color of interactions outside modules. 9 | #' @param axes_titles Titles for axes 10 | #' 11 | #' @details Use ggplot to plot a matrix in which cells (network interactions) 12 | #' are colored. Interactions that fall outside the modules are colored in 13 | #' \code{outside_module_col} and those that fall inside the module are colored 14 | #' by colors automatically generated by \code{gg_color_hue} from package metafolio. 15 | #' 16 | #' @examples 17 | #' \dontrun{ 18 | #' network_object <- create_monolayer_network(bipartite::memmott1999, 19 | #' bipartite = TRUE, directed = FALSE, group_names = c('A','P')) 20 | #' 21 | #' infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 22 | #' flow_model = 'undirected', 23 | #' silent=TRUE, trials=20, two_level=TRUE, seed=123) 24 | #' plot_modular_matrix(infomap_object, fix_coordinates = TRUE) 25 | #' } 26 | #' 27 | #' @return An object of class \code{ggplot}. 28 | #' 29 | #' @seealso \code{ggplot2, infomap_monolayer} 30 | #' 31 | #' @export 32 | ## @import dplyr 33 | ## @import magrittr 34 | ## @import ggplot2 35 | plot_modular_matrix <- function(x, fix_coordinates=T, axes_titles=c('Set 1', 'Set 2'), transpose=F, outside_module_col='gray'){ 36 | 37 | if(class(x)!='infomap_monolayer'){stop('x must be of class infomap_monolayer')} 38 | 39 | # Add module affiliations to the edge list, module 1 is the affiliation of the node from Set1; module2 is the affiliation of the node from Set2 40 | M_set1 <- M_set2 <- x$edge_list[1:3] 41 | names(M_set1) <- names(M_set2) <- names(x$edge_list)[1:3] <- c('Set1','Set2','w') 42 | suppressMessages(suppressWarnings(M_set1 %<>% left_join(x$modules, by=c('Set1'='node_name')) %>% rename(module1=module_level1))) 43 | suppressMessages(suppressWarnings(M_set2 %<>% left_join(x$modules, by=c('Set2'='node_name')) %>% rename(module2=module_level1))) 44 | # Join into a single tibble 45 | suppressMessages(suppressWarnings( 46 | M <- full_join(M_set1, M_set2, by = c("Set1", "Set2", "w")) %>% 47 | dplyr::select(Set1, Set2, w, module1, module2) 48 | )) 49 | # Order by modules 50 | Set1_modules <- unique(M_set1[,c('Set1','module1')]) 51 | Set1_modules <- with(Set1_modules, Set1_modules[order(module1,Set1),]) 52 | Set2_modules <- unique(M_set2[,c('Set2','module2')]) 53 | Set2_modules <- with(Set2_modules, Set2_modules[order(module2,Set2),]) 54 | 55 | M %<>% 56 | mutate(edge_in_out=ifelse(module1==module2,'in','out')) %>% # Determine if an interaction falls inside or outside a module 57 | mutate(value_mod=ifelse(edge_in_out=='in',module1,0)) %>% # Assign a module value of 0 if interaction falls outside the modules 58 | mutate(Set1=factor(Set1, levels=Set1_modules$Set1), Set2=factor(Set2, levels=Set2_modules$Set2)) 59 | # Define module colors 60 | module_colors <- tibble(module1=unique(M$module1), col=gg_color_hue(n=length(unique(M$module1)))) 61 | # Join the module colors to the edge list 62 | # If there are no interactions outside the module then do not need the gray 63 | # color. Otherwise, it will plot the first module in gray. 64 | 65 | suppressMessages(M %<>% left_join(module_colors) %>% 66 | mutate(col=ifelse(edge_in_out=='in',col,outside_module_col))) 67 | 68 | # Generate a plot of a modular matrix 69 | if (transpose){ 70 | p <- ggplot()+ 71 | geom_tile(data=M %>% filter(w!=0), aes(Set2, Set1, fill=col)) # Interactions within modules 72 | } else { 73 | p <- ggplot()+ 74 | geom_tile(data=M %>% filter(w!=0), aes(Set1, Set2, fill=col)) # Interactions within modules 75 | # geom_tile(data=M %>% filter(w==0), aes(Set1, Set2), fill='white') + # Add nodes with no interactions, if they exist 76 | } 77 | p <- p + 78 | labs(x=axes_titles[2], y=axes_titles[1]) + 79 | scale_fill_identity()+ 80 | theme(legend.position='none', 81 | panel.grid.major = element_blank(), 82 | panel.grid.minor = element_blank(), 83 | panel.background = element_blank(), 84 | axis.text.x = element_text(angle = 90), 85 | # axis.text.y = element_blank(), 86 | axis.ticks = element_blank()) 87 | if (fix_coordinates){ 88 | p <- p+coord_fixed() 89 | } 90 | return(p) 91 | } 92 | 93 | -------------------------------------------------------------------------------- /R/plot_multilayer_alluvial.R: -------------------------------------------------------------------------------- 1 | #' Alluvial plot for multilayer network 2 | #' 3 | #' @param x An object of class \code{infomap_multilayer}. 4 | #' @param module_labels Should module labels be presented 5 | #' 6 | #' @details Use ggplot and ggalluvial to plot an alluvial plot that shows the flow of nodes between modules. Very useful for temporal networks. Because the output is 7 | #' a ggplot object it can be further manipulated with standard ggplot2. 8 | #' 9 | #' @return An object of class \code{ggplot}. 10 | #' 11 | #' @seealso \code{ggplot2, ggalluvial, infomap_monolayer} 12 | #' 13 | #' @examples 14 | #' \dontrun{ 15 | #' emln <- create_multilayer_object(extended = siberia1982_7_links, 16 | #' nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) 17 | #' 18 | #' emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, 19 | #' flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, 20 | #' temporal_network = TRUE) 21 | #' 22 | #' # Plot alluvial diagram 23 | #' plot_multilayer_alluvial(emln_modules, module_labels = FALSE) 24 | #' 25 | #' # Can also modify the plot 26 | #' plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+ 27 | #' geom_stratum(linetype='dashed', color='gray')+ 28 | #' scale_x_continuous(breaks=seq(0,6,1))+ 29 | #' scale_y_continuous(breaks=seq(0,70,5))+ 30 | #' labs(y='Number of species')+ 31 | #' theme_bw()+ 32 | #' theme(legend.position = "none", 33 | #' panel.grid = element_blank(), 34 | #' axis.text = element_text(color='black', size = 20), 35 | #' axis.title = element_text(size=20)) 36 | #' } 37 | #' 38 | #' @export 39 | #' 40 | ## @import ggalluvial 41 | ## @import ggplot2 42 | plot_multilayer_alluvial <- function(x, module_labels=F){ 43 | if(class(x)!='infomap_multilayer'){stop('x must be of class infomap_multilayer')} 44 | p <- ggplot(x$modules, 45 | aes(x=layer_id, stratum=as.factor(module), 46 | alluvium=node_id, 47 | label=as.factor(module), 48 | fill=as.factor(module)))+ 49 | ggalluvial::geom_flow(stat = "alluvium", lode.guidance = "frontback", color = "darkgray")+ 50 | ggalluvial::geom_stratum() + 51 | labs(x='Layer', y='Number of nodes')+ 52 | theme_bw() 53 | if (module_labels){ 54 | p <- p+geom_text(stat = "stratum") 55 | } 56 | return(p) 57 | } 58 | 59 | -------------------------------------------------------------------------------- /R/plot_multilayer_modules.R: -------------------------------------------------------------------------------- 1 | #' Plot modules across layers for multilayer networks 2 | #' 3 | #' @param x An object of class \code{infomap_multilayer}. 4 | #' @param type Plot type, circles or rectangles. See details. 5 | #' @param color_modules Color modules? See details. 6 | #' 7 | #' @details Type \code{circle} plots a circle per module-layer combination, with the radius proportional 8 | #' to the number of nodes in the module in the layer. Type \code{rectangle} plots a bar across all the layers a module spans. Only (or mostly) relevant for temporal networks. 9 | #' 10 | #' For a circle plot, \code{color_modules} will give a different color for 11 | #' each module ID. For a rectangle plot, \code{color_modules} will color each 12 | #' module by the total number of nodes it contains (not per layer). 13 | #' 14 | #' Because the output is a ggplot object it can be further manipulated with standard 15 | #' ggplot2. 16 | #' 17 | #' @return An object of class \code{ggplot}. 18 | #' 19 | #' @seealso \code{ggplot2, infomap_monolayer} 20 | #' 21 | #' @references Code was first developed for: Pilosof, S., Q. He, K. E. Tiedje, 22 | #' S. Ruybal-Pesántez, K. P. Day, and M. Pascual. 2019. Competition for hosts 23 | #' modulates vast antigenic diversity to generate persistent strain structure 24 | #' in Plasmodium falciparum. PLoS biology 17:e3000336. 25 | #' 26 | #' @examples 27 | #' \dontrun{ 28 | #' emln <- create_multilayer_object(extended = siberia1982_7_links, 29 | #' nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) 30 | #' 31 | #' emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, 32 | #' flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, 33 | #' temporal_network = TRUE) 34 | #' 35 | # Rectangle-type plot 36 | #'plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ 37 | #' scale_fill_viridis_c() 38 | #'plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = FALSE)+ 39 | #' geom_rect(fill='orange') 40 | #' 41 | #'# Circle-type plot 42 | #'plot_multilayer_modules(emln_modules, type = 'circle', color_modules = TRUE) 43 | #' 44 | #'plot_multilayer_modules(emln_modules, type = 'circle', color_modules = FALSE)+ 45 | #' geom_point(aes(size=size), color='navy') 46 | #' 47 | #'# More examples to modify the plots 48 | #'plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ 49 | #' scale_fill_viridis_c()+ 50 | #' scale_x_continuous(breaks=seq(0,6,1))+ 51 | #' scale_y_continuous(breaks=seq(0,40,5))+ 52 | #' theme_bw()+ 53 | #' theme(panel.grid.major = element_blank(), 54 | #' panel.grid.minor = element_blank(), 55 | #' axis.title = element_text(size=20), 56 | #' axis.text = element_text(size = 20), 57 | #' legend.text = element_text(size=15), 58 | #' legend.title = element_text(size=20)) 59 | #' } 60 | #' 61 | #' @export 62 | #' 63 | ## @import ggalluvial 64 | ## @import ggplot2 65 | plot_multilayer_modules <- function(x, type=c('circle', 'rectangle'), color_modules=T){ 66 | if (type=='rectangle'){ 67 | p <- x$modules %>% 68 | group_by(module) %>% 69 | summarise(b=min(layer_id), #birth 70 | d=max(layer_id), # death 71 | persistence=d-b+1, 72 | size=n_distinct(node_id)) %>% # Number of species in the module 73 | ggplot(aes(xmin=b, xmax=d+0.05, ymin=module, ymax=module+0.5))+ 74 | geom_rect()+ 75 | labs(x='Layer', y='Module ID', fill='Module size') 76 | if (color_modules){ p <- p+geom_rect(aes(fill=size)) } 77 | } 78 | 79 | if (type=='circle'){ 80 | p <- x$modules %>% 81 | group_by(module, layer_id) %>% 82 | summarise(size=n_distinct(node_id)) %>% 83 | ggplot(aes(x=layer_id, y=module))+ 84 | labs(x='Layer', y='Module ID', fill='Module size') 85 | if (color_modules){ 86 | p <- p+geom_point(aes(size=size, color=as.factor(module))) 87 | } else { 88 | p <- p+geom_point(aes(size=size)) 89 | } 90 | } 91 | return(p) 92 | } 93 | -------------------------------------------------------------------------------- /R/plot_signif.R: -------------------------------------------------------------------------------- 1 | #'Plot histograms for randomizations 2 | #' 3 | #'@details Use ggplot to plot two histograms for the values of the map equation 4 | #' L and the number of modules. Dashed line is the observed value. Because 5 | #' returned objects are ggplot objects, they can be modified. 6 | #' 7 | #'@param x An object of class \code{infomap_monolayer}. 8 | #'@param colors The fill colors of the histograms. 9 | #'@param plotit Also show the plots? 10 | #' 11 | #'@return A list with objecst of class \code{ggplot}: 12 | #'\itemize{ 13 | #'\item L_plot: Histogram for the map equation 14 | #'\item m_plot: Histogram for the number of modules 15 | #'} 16 | #' 17 | #'@seealso \code{ggplot2, infomap_monolayer} 18 | #' 19 | #' 20 | #' @examples 21 | #' \dontrun{ 22 | #' network_object <- create_monolayer_network(bipartite::memmott1999, 23 | #' bipartite = TRUE, directed = FALSE, group_names = c('Animals','Plants')) 24 | #' infomap_object <- run_infomap_monolayer(network_object, 25 | #' infomap_executable='Infomap', 26 | #' flow_model = 'undirected', 27 | #' silent=TRUE, trials=20, two_level=TRUE, seed=123, 28 | #' signif = TRUE, shuff_method = 'r00', nsim = 50) 29 | #' 30 | #' #get plots and plot them 31 | #' x <- plot_signif(infomap_object, plotit = TRUE) 32 | #' 33 | #' # Can modify the plots with ggplot2 34 | #' x$L_plot+ 35 | #' theme_bw()+ 36 | #' theme(legend.position='none', 37 | #' axis.text = element_text(size=20), 38 | #' axis.title = element_text(size=20)) 39 | #' 40 | #' } 41 | #'@export 42 | #' 43 | ##@import dplyr 44 | ##@import magrittr 45 | ##@import ggplot2 46 | plot_signif <- function(x, colors=c('plum','tomato4'), plotit=T){ 47 | if(class(x)!='infomap_monolayer'){stop('x must be of class infomap_monolayer')} 48 | p1 <- tibble(L_sim=x$L_sim) %>% 49 | ggplot(aes(L_sim))+ 50 | geom_histogram(fill=colors[1])+ 51 | geom_vline(xintercept = x$L, linetype='dashed')+ 52 | labs(x='Map equation L', y='Number shuffled networks') 53 | p2 <- tibble(m_sim=x$m_sim) %>% 54 | ggplot(aes(m_sim))+ 55 | geom_histogram(fill=colors[2])+ 56 | geom_vline(xintercept = x$m, linetype='dashed')+ 57 | labs(x='Number of modules', y='Number shuffled networks') 58 | # Show plots? 59 | if (plotit){print(cowplot::plot_grid(p1,p2,align = 'vh'))} 60 | 61 | return(list(L_plot=p1, m_plot=p2)) 62 | } 63 | 64 | -------------------------------------------------------------------------------- /R/shuffle_infomap.R: -------------------------------------------------------------------------------- 1 | #' Shuffle a network and return linklists for Infomap (beta) 2 | #' 3 | #' Shuffles the network according to a predefined algorithm and return a list of 4 | #' linklists that can be analyzed by Infomap. 5 | #' 6 | #' @details This function is used internally by 7 | #' \code{run_infomap_monolayer}, but can also be run independently 8 | #' Currently only supports bipartite networks and shuffling methods from the 9 | #' vegan package as defined in \code{vegan::commsim}. 10 | #' 11 | #' @param x An object of class \code{infomap_link_list} or \code{monolayer}. 12 | #' @param shuff_method Method to shuffle the network. See details. 13 | #' @param nsim How many shuffled networks to create? 14 | #' @param ... Additional parameters for shuffling passed to \code{simulate}, such as burnin. See \code{nullmodel} in package \code{vegan}. 15 | #' 16 | #' @return A list of linklists that can be used by Infomap. 17 | #' 18 | #' @seealso Functions \code{commsim, nullmodel} in package \code{vegan}. 19 | #' 20 | #' @examples 21 | #' network_object <- create_monolayer_network(bipartite::memmott1999, 22 | #' bipartite = TRUE, directed = FALSE, group_names = c('A','P')) 23 | #' 24 | #' shuffled <- shuffle_infomap(network_object, shuff_method='curveball', 25 | #' nsim=50, burnin=2000) 26 | #' 27 | #' @export 28 | #' 29 | #' 30 | #' @importFrom magrittr '%<>%' '%>%' 31 | #' @importFrom dplyr left_join select 32 | #' @importFrom vegan nullmodel commsim 33 | #' @importFrom igraph graph.incidence 34 | #' @importFrom stats simulate 35 | 36 | 37 | shuffle_infomap <- function(x, shuff_method='r00', nsim=1000, ...){ 38 | print('Shuffling...') 39 | null <- vegan::nullmodel(x$mat, shuff_method) 40 | shuffled <- simulate(null, nsim = nsim, ...) 41 | shuffled_linklist <- NULL 42 | for (i in 1:nsim){ 43 | g <- graph.incidence(t(shuffled[,,i]), weighted = T) 44 | link_list <- as_tibble(igraph::as_data_frame(g, "edges")) 45 | link_list %<>% 46 | left_join(x$nodes, by=c('from' = 'node_name')) %>% 47 | left_join(x$nodes, by=c('to' = 'node_name')) %>% 48 | select(from=node_id.x, to=node_id.y, weight) 49 | shuffled_linklist[[i]] <- link_list 50 | } 51 | return(shuffled_linklist) 52 | } 53 | -------------------------------------------------------------------------------- /R/siberia1982_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1982 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1982_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1982_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1982_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia1983_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1983 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1983_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1983_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1983_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia1984_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1984 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1984_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1984_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1984_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia1985_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1985 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1985_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1985_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1985_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia1986_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1986 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1986_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1986_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1986_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia1987_matrix.R: -------------------------------------------------------------------------------- 1 | #' Siberia 1987 host-parasite temporal matrix 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' @format A numeric matrix with rows representing host species and columns representing parasite species. 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia1987_matrix) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' bipartite = T, 58 | #' directed = F, physical_node_attributes = siberia_nodes ) 59 | 60 | siberia1987_matrix <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 61 | 62 | 63 | # Export the dataset using data() 64 | #' @export 65 | data(siberia1987_matrix) 66 | -------------------------------------------------------------------------------- /R/siberia_interlayer.R: -------------------------------------------------------------------------------- 1 | #' Siberia interlayer edges 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia_nodes} for information about the nodes. 19 | #' 20 | #' See \code{siberia1982_matrix} Siberia 1982 host-parasite temporal matrix. 21 | #' 22 | #' @format Edge list format (layer_from node_from layer_to node_to weight). 23 | #' 24 | #' @source Simulated data for illustration purposes. 25 | #' 26 | #' @docType data 27 | #' 28 | #' @usage data(siberia_interlayer) 29 | #' 30 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 31 | #' 32 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 33 | #' 34 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 35 | #' 36 | #' 37 | #' @examples 38 | #' data(siberia1982_matrix) 39 | #' data(siberia1983_matrix) 40 | #' data(siberia1984_matrix) 41 | #' data(siberia1985_matrix) 42 | #' data(siberia1986_matrix) 43 | #' data(siberia1987_matrix) 44 | #' data(siberia_nodes) 45 | #' data(siberia_interlayer) 46 | #' 47 | #' # Create a multilayer object 48 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | #' 50 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | #' siberia1983_matrix, 52 | #' siberia1984_matrix, 53 | #' siberia1985_matrix, 54 | #' siberia1986_matrix, 55 | #' siberia1987_matrix), 56 | #' layer_attributes = layer_attrib, 57 | #' interlayer_links = siberia_interlayer, 58 | #' bipartite = T, 59 | #' directed = F, physical_node_attributes = siberia_nodes ) 60 | 61 | siberia_interlayer <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 62 | 63 | 64 | # Export the dataset using data() 65 | #' @export 66 | data(siberia_interlayer) 67 | -------------------------------------------------------------------------------- /R/siberia_nodes.R: -------------------------------------------------------------------------------- 1 | #' Host-parasite temporal multilayer network: nodes 2 | #' 3 | #' Host-parasite temporal multilayer network. 4 | #' This data set contains the matrices of a temporal multilayer 5 | #' network representing the infection of 22 small mammalian host species by 6 | #' 56 ectoparasite species during 6 consecutive summers in Siberia 7 | #' (1982–1987). 8 | #' 9 | #' @details The data set is in an matrix format.Each layer is a host-parasite bipartite network. 10 | #' Intralayer edges between a parasite species and a host species are the 11 | #' number of parasite individuals divided by the number of host individuals. 12 | #' Interlayer coupling edges connect each physical node to itself in the next 13 | #' layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 14 | #' the number of individuals in layer l+1 divided by the number of individuals 15 | #' in layer l. They therefore represent population dynamics. Interlayer edges 16 | #' only go one way (_l-->l+1_) because time flow one way. 17 | #' 18 | #' See \code{siberia1982_matrix} Siberia 1982 host-parasite temporal matrix. 19 | #' 20 | #' See \code{siberia_interlayer} for information about the interlayer edges. 21 | #' 22 | #' 23 | #' @source Simulated data for illustration purposes. 24 | #' 25 | #' @docType data 26 | #' 27 | #' @usage data(siberia_nodes) 28 | #' 29 | #' @references Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 30 | #' 31 | #' Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 32 | #' 33 | #' Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 34 | #' 35 | #' 36 | #' @examples 37 | #' data(siberia1982_matrix) 38 | #' data(siberia1983_matrix) 39 | #' data(siberia1984_matrix) 40 | #' data(siberia1985_matrix) 41 | #' data(siberia1986_matrix) 42 | #' data(siberia1987_matrix) 43 | #' data(siberia_nodes) 44 | #' data(siberia_interlayer) 45 | #' 46 | #' # Create a multilayer object 47 | #' layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 48 | #' 49 | #' multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 50 | #' siberia1983_matrix, 51 | #' siberia1984_matrix, 52 | #' siberia1985_matrix, 53 | #' siberia1986_matrix, 54 | #' siberia1987_matrix), 55 | #' layer_attributes = layer_attrib, 56 | #' bipartite = T, 57 | #' directed = F, physical_node_attributes = siberia_nodes ) 58 | 59 | siberia_nodes <- matrix(c(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0), nrow = 3, ncol = 4) 60 | 61 | 62 | # Export the dataset using data() 63 | #' @export 64 | data(siberia_nodes) 65 | -------------------------------------------------------------------------------- /R/tur2016-data.R: -------------------------------------------------------------------------------- 1 | #' Pollen movement data 2 | #' 3 | #' Data on conspecific and heterospecific movement of pollen grains. 4 | #' 5 | #' @docType data 6 | #' 7 | #' @usage data(tur2016) 8 | #' 9 | #' @keywords datasets 10 | #' 11 | #' @references Tur C, Sáez A, Traveset A, Aizen MA. Evaluating the effects of 12 | #' pollinator-mediated interactions using pollen transfer networks: evidence 13 | #' of widespread facilitation in south Andean plant communities. Ecol Lett. 14 | #' 2016;19: 576–586. 15 | #' 16 | #' \href{https://onlinelibrary.wiley.com/doi/abs/10.1111/ele.12594}{Link to paper} 17 | #' 18 | #' @source 19 | #' \href{https://figshare.com/articles/dataset/Data_package_from_Evaluating_the_effects_of_pollinator_mediated_interactions_using_pollen_transfer_networks_evidence_of_widespread_facilitation_in_south_Andean_plant_communities_Tur_et_al_2016_/2242447}{Data 20 | #' on Figshare} 21 | #' 22 | #' @examples 23 | #' data(tur2016) 24 | "tur2016" 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 16 | 17 | [![](https://img.shields.io/badge/doi-10.1111/2041--210X.13569-orange.svg)](https://doi.org/10.1111/2041-210X.13569) [![](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) ![](https://img.shields.io/badge/devtools%20installation-v2.0-yellow.svg) 18 | 19 | ## :wave: About 20 | **This repository contains the code for the R package infomapecology.** infomapecology is an R package with functions that prepare monolayer and multilayer networks for analysis with Infomap, run Infomap from within R and parse the results back to R. It is inspired by analysis of ecological networks but is suitable for other areas of research as well. 21 | 22 | ## :page_facing_up: Paper and citing 23 | Farage, C., D. Edler, A. Eklöf, M. Rosvall, and S. Pilosof. **Identifying flow modules in ecological networks using Infomap**. Methods in Ecology and Evolution. 2021. [DOI:10.1111/2041-210X.13569](https://onlinelibrary.wiley.com/doi/10.1111/2041-210X.13569). Please cite the paper when implementing the guidelines we describe or when using the package, this helps us a lot! 24 | 25 | 26 | ## :green_heart: Acknowledgements 27 | This work was supported by: 28 | * Israel Science Foundation (grant 1281/20) to Shai Pilosof. 29 | * Swedish Research Council (grant no. 2016-00796) to Martin Rosvall. 30 | * Swedish Research Council (grant no. 2016-04919) to Anna Eklof. 31 | 32 | ## :package: Installation 33 | Current installation uses devtools. Instructions: https://ecological-complexity-lab.github.io/infomap_ecology_package/installation 34 | 35 | 36 | ## :globe_with_meridians: Website 37 | Complete instructions for installation and many examples are in [https://ecological-complexity-lab.github.io/infomap_ecology_package/](https://ecological-complexity-lab.github.io/infomap_ecology_package/). 38 | -------------------------------------------------------------------------------- /code_from_paper/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/code_from_paper/.DS_Store -------------------------------------------------------------------------------- /code_from_paper/gillaranz.csv: -------------------------------------------------------------------------------- 1 | from,to,weight,within_mod,color 2 | 1,3,1,TRUE,blue 3 | 1,4,1,TRUE,blue 4 | 2,3,1,TRUE,blue 5 | 2,4,1,TRUE,blue 6 | 2,16,1,FALSE,black 7 | 3,4,1,TRUE,blue 8 | 3,5,1,TRUE,blue 9 | 3,6,1,FALSE,black 10 | 4,5,1,TRUE,blue 11 | 5,8,1,FALSE,black 12 | 6,9,1,TRUE,green 13 | 6,10,1,TRUE,green 14 | 6,7,1,TRUE,green 15 | 6,8,1,TRUE,green 16 | 6,18,1,FALSE,black 17 | 7,8,1,TRUE,green 18 | 7,9,1,TRUE,green 19 | 7,10,1,TRUE,green 20 | 7,12,1,FALSE,black 21 | 8,9,1,TRUE,green 22 | 8,10,1,TRUE,green 23 | 8,17,1,FALSE,black 24 | 9,10,1,TRUE,green 25 | 11,18,1,FALSE,black 26 | 11,13,1,TRUE,orange 27 | 11,15,1,TRUE,orange 28 | 12,14,1,TRUE,orange 29 | 12,13,1,TRUE,orange 30 | 12,15,1,TRUE,orange 31 | 13,15,1,TRUE,orange 32 | 13,14,1,TRUE,orange 33 | 14,15,1,TRUE,orange 34 | 16,18,1,TRUE,red 35 | 16,19,1,TRUE,red 36 | 17,18,1,TRUE,red 37 | 17,20,1,TRUE,red 38 | 17,19,1,TRUE,red 39 | 18,20,1,TRUE,red 40 | 18,19,1,TRUE,red 41 | 19,20,1,TRUE,red 42 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/.DS_Store -------------------------------------------------------------------------------- /data/kongsfjorden_links.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/kongsfjorden_links.RData -------------------------------------------------------------------------------- /data/kongsfjorden_nodes.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/kongsfjorden_nodes.RData -------------------------------------------------------------------------------- /data/otago_links.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/otago_links.RData -------------------------------------------------------------------------------- /data/otago_nodes.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/otago_nodes.RData -------------------------------------------------------------------------------- /data/siberia1982_7_links.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1982_7_links.rda -------------------------------------------------------------------------------- /data/siberia1982_7_nodes.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1982_7_nodes.rda -------------------------------------------------------------------------------- /data/siberia1982_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1982_matrix.rda -------------------------------------------------------------------------------- /data/siberia1983_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1983_matrix.rda -------------------------------------------------------------------------------- /data/siberia1984_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1984_matrix.rda -------------------------------------------------------------------------------- /data/siberia1985_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1985_matrix.rda -------------------------------------------------------------------------------- /data/siberia1986_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1986_matrix.rda -------------------------------------------------------------------------------- /data/siberia1987_matrix.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia1987_matrix.rda -------------------------------------------------------------------------------- /data/siberia_interlayer.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia_interlayer.rda -------------------------------------------------------------------------------- /data/siberia_nodes.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/siberia_nodes.rda -------------------------------------------------------------------------------- /data/tur2016.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/data/tur2016.RData -------------------------------------------------------------------------------- /docs/Infomap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/Infomap -------------------------------------------------------------------------------- /docs/bipartite_files/figure-html/Bipartite_1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/bipartite_files/figure-html/Bipartite_1-1.png -------------------------------------------------------------------------------- /docs/ecomplab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/ecomplab.png -------------------------------------------------------------------------------- /docs/hypothesis_test_files/figure-html/hypothesis_1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/hypothesis_test_files/figure-html/hypothesis_1-1.png -------------------------------------------------------------------------------- /docs/hypothesis_test_files/figure-html/hypothesis_1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/hypothesis_test_files/figure-html/hypothesis_1-2.png -------------------------------------------------------------------------------- /docs/hypothesis_test_files/figure-html/hypothesis_2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/hypothesis_test_files/figure-html/hypothesis_2-1.png -------------------------------------------------------------------------------- /docs/hypothesis_test_files/figure-html/hypothesis_4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/hypothesis_test_files/figure-html/hypothesis_4-1.png -------------------------------------------------------------------------------- /docs/hypothesis_test_files/figure-html/hypothesis_4-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/hypothesis_test_files/figure-html/hypothesis_4-2.png -------------------------------------------------------------------------------- /docs/logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/logos.png -------------------------------------------------------------------------------- /docs/logos_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/logos_6.png -------------------------------------------------------------------------------- /docs/logos_new31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/logos_new31.jpg -------------------------------------------------------------------------------- /docs/monolayer_heirarchical_files/figure-html/monolayer_heirarchical_2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/monolayer_heirarchical_files/figure-html/monolayer_heirarchical_2-1.png -------------------------------------------------------------------------------- /docs/monolayer_heirarchical_files/figure-html/monolayer_heirarchical_2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/monolayer_heirarchical_files/figure-html/monolayer_heirarchical_2-2.png -------------------------------------------------------------------------------- /docs/monolayer_node_attributes_files/figure-html/monolayer_node_attribut_2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/monolayer_node_attributes_files/figure-html/monolayer_node_attribut_2-1.png -------------------------------------------------------------------------------- /docs/multilayer_interlayer_emln_files/figure-html/multilayer_inter_2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/multilayer_interlayer_emln_files/figure-html/multilayer_inter_2-1.png -------------------------------------------------------------------------------- /docs/multilayer_interlayer_emln_files/figure-html/multilayer_inter_2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/multilayer_interlayer_emln_files/figure-html/multilayer_inter_2-2.png -------------------------------------------------------------------------------- /docs/multilayer_relax_emln_files/figure-html/multilayer_emln_3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/multilayer_relax_emln_files/figure-html/multilayer_emln_3-1.png -------------------------------------------------------------------------------- /docs/otago_node_attributes.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 2 1 3 | 3 1 4 | 4 2 5 | 5 3 6 | 6 4 7 | 7 5 8 | 8 5 9 | 9 6 10 | 10 6 11 | 11 7 12 | 12 7 13 | 13 7 14 | 14 7 15 | 15 7 16 | 16 7 17 | 17 7 18 | 18 7 19 | 19 7 20 | 20 7 21 | 21 7 22 | 22 7 23 | 23 7 24 | 24 7 25 | 25 7 26 | 26 7 27 | 27 7 28 | 28 7 29 | 29 7 30 | 30 8 31 | 31 8 32 | 32 9 33 | 33 10 34 | 34 10 35 | 35 10 36 | 36 10 37 | 37 10 38 | 38 11 39 | 39 12 40 | 40 12 41 | 41 13 42 | 42 13 43 | 43 13 44 | 44 14 45 | 45 14 46 | 46 14 47 | 47 14 48 | 48 14 49 | 49 15 50 | 50 15 51 | 51 15 52 | 52 15 53 | 53 15 54 | 54 15 55 | 55 16 56 | 56 5 57 | 57 6 58 | 58 6 59 | 59 6 60 | 60 6 61 | 61 7 62 | 62 7 63 | 63 7 64 | 64 7 65 | 65 7 66 | 66 7 67 | 67 7 68 | 68 7 69 | 69 7 70 | 70 7 71 | 71 7 72 | 72 7 73 | 73 7 74 | 74 7 75 | 75 7 76 | 76 7 77 | 77 7 78 | 78 7 79 | 79 7 80 | 80 7 81 | 81 7 82 | 82 8 83 | 83 17 84 | 84 10 85 | 85 10 86 | 86 10 87 | 87 10 88 | 88 10 89 | 89 11 90 | 90 11 91 | 91 13 92 | 92 14 93 | 93 14 94 | 94 14 95 | 95 14 96 | 96 14 97 | 97 18 98 | 98 15 99 | 99 14 100 | 100 19 101 | 101 19 102 | 102 19 103 | 103 19 104 | 104 19 105 | 105 20 106 | 106 20 107 | 107 21 108 | 108 21 109 | 109 21 110 | 110 21 111 | 111 21 112 | 112 21 113 | 113 21 114 | 114 21 115 | 115 21 116 | 116 21 117 | 117 21 118 | 118 21 119 | 119 21 120 | 120 21 121 | 121 21 122 | 122 21 123 | 123 21 124 | 124 22 125 | 125 22 126 | 126 22 127 | 127 22 128 | 128 22 129 | 129 22 130 | 130 22 131 | 131 22 132 | 132 22 133 | 133 22 134 | 134 23 135 | 135 23 136 | 136 24 137 | 137 24 138 | 138 25 139 | 139 22 140 | 140 13 141 | -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/Lato.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/Lato.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/LatoBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/LatoBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/LatoItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/LatoItalic.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/NewsCycle.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/NewsCycle.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSans.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/Raleway.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/Raleway.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/RalewayBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/RalewayBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/Roboto.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoLight.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/css/fonts/Ubuntu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/css/fonts/Ubuntu.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/shim/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | // Only run this code in IE 8 5 | if (!!window.navigator.userAgent.match("MSIE 8")) { 6 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document); 7 | }; 8 | -------------------------------------------------------------------------------- /docs/site_libs/bootstrap-3.3.5/shim/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl 2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT 3 | * */ 4 | 5 | // Only run this code in IE 8 6 | if (!!window.navigator.userAgent.match("MSIE 8")) { 7 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/site_libs/highlightjs-9.12.0/default.css: -------------------------------------------------------------------------------- 1 | .hljs-literal { 2 | color: #990073; 3 | } 4 | 5 | .hljs-number { 6 | color: #099; 7 | } 8 | 9 | .hljs-comment { 10 | color: #998; 11 | font-style: italic; 12 | } 13 | 14 | .hljs-keyword { 15 | color: #900; 16 | font-weight: bold; 17 | } 18 | 19 | .hljs-string { 20 | color: #d14; 21 | } 22 | -------------------------------------------------------------------------------- /docs/site_libs/highlightjs-9.12.0/textmate.css: -------------------------------------------------------------------------------- 1 | .hljs-literal { 2 | color: rgb(88, 72, 246); 3 | } 4 | 5 | .hljs-number { 6 | color: rgb(0, 0, 205); 7 | } 8 | 9 | .hljs-comment { 10 | color: rgb(76, 136, 107); 11 | } 12 | 13 | .hljs-keyword { 14 | color: rgb(0, 0, 255); 15 | } 16 | 17 | .hljs-string { 18 | color: rgb(3, 106, 7); 19 | } 20 | -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/README: -------------------------------------------------------------------------------- 1 | This a jQuery UI custom build, downloaded from: 2 | http://jqueryui.com/download/#!version=1.11.4&components=1111111111110111111111111111111111111 3 | 4 | It includes all components except the datepicker, because it conflicts with 5 | bootstrap-datepicker that is packaged with Shiny. 6 | 7 | The copy of jQuery that is bundled with the download, under external/, is not 8 | included because Shiny already has its own copy of jQuery. 9 | -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/jqueryui-1.11.4/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/docs/site_libs/jqueryui-1.11.4/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /docs/site_libs/klippy-0.0.0.9500/css/klippy.min.css: -------------------------------------------------------------------------------- 1 | .klippy{overflow:visible;position:relative}.btn-klippy{position:absolute;border:0;padding:1px 0 0 1px;background-color:transparent}.btn-klippy>div{margin:0;padding:0}.btn-klippy .octicon{display:inline-block;margin:0;padding:0}.btn-klippy:focus{outline:0}.btn-klippy:focus .octicon{border-width:thin;border-style:dotted;border-color:gray;border-radius:3px} 2 | -------------------------------------------------------------------------------- /docs/site_libs/klippy-0.0.0.9500/js/klippy.min.js: -------------------------------------------------------------------------------- 1 | function addClassKlippyToPreCode(){document.addEventListener("DOMContentLoaded",function(){for(var e=document.querySelectorAll("pre > code"),t=0;t';return"data:image/svg+xml;base64,"+window.btoa(l)}function initKlippy(t,o,n,l,i,a){document.addEventListener("DOMContentLoaded",function(){for(var r=getUriOcticonClippy(n,l),c="",d=document.querySelectorAll(".klippy > code"),p=0;p summary.chunk-summary { 2 | text-align: right; 3 | } 4 | details.chunk-details[open] > summary.chunk-summary::after { 5 | content: "Hide"; 6 | } 7 | details.chunk-details[open] > summary.chunk-summary > span.chunk-summary-text { 8 | display: none; 9 | } 10 | -------------------------------------------------------------------------------- /docs/site_libs/navigation-1.1/codefolding.js: -------------------------------------------------------------------------------- 1 | 2 | window.initializeCodeFolding = function(show) { 3 | 4 | // handlers for show-all and hide all 5 | $("#rmd-show-all-code").click(function() { 6 | $('div.r-code-collapse').each(function() { 7 | $(this).collapse('show'); 8 | }); 9 | }); 10 | $("#rmd-hide-all-code").click(function() { 11 | $('div.r-code-collapse').each(function() { 12 | $(this).collapse('hide'); 13 | }); 14 | }); 15 | 16 | // index for unique code element ids 17 | var currentIndex = 1; 18 | 19 | // select all R code blocks 20 | var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia, pre.foldable'); 21 | rCodeBlocks.each(function() { 22 | // skip if the block has fold-none class 23 | if ($(this).hasClass('fold-none')) return; 24 | 25 | // create a collapsable div to wrap the code in 26 | var div = $('
'); 27 | var showThis = (show || $(this).hasClass('fold-show')) && !$(this).hasClass('fold-hide'); 28 | var id = 'rcode-643E0F36' + currentIndex++; 29 | div.attr('id', id); 30 | $(this).before(div); 31 | $(this).detach().appendTo(div); 32 | 33 | // add a show code button right above 34 | var showCodeText = $('' + (showThis ? 'Hide' : 'Code') + ''); 35 | var showCodeButton = $(''); 36 | showCodeButton.append(showCodeText); 37 | showCodeButton 38 | .attr('data-toggle', 'collapse') 39 | .attr('data-bs-toggle', 'collapse') // BS5 40 | .attr('data-target', '#' + id) 41 | .attr('data-bs-target', '#' + id) // BS5 42 | .attr('aria-expanded', showThis) 43 | .attr('aria-controls', id); 44 | 45 | var buttonRow = $('
'); 46 | var buttonCol = $('
'); 47 | 48 | buttonCol.append(showCodeButton); 49 | buttonRow.append(buttonCol); 50 | 51 | div.before(buttonRow); 52 | 53 | // show the div if necessary 54 | if (showThis) div.collapse('show'); 55 | 56 | // update state of button on show/hide 57 | // * Change text 58 | // * add a class for intermediate states styling 59 | div.on('hide.bs.collapse', function () { 60 | showCodeText.text('Code'); 61 | showCodeButton.addClass('btn-collapsing'); 62 | }); 63 | div.on('hidden.bs.collapse', function () { 64 | showCodeButton.removeClass('btn-collapsing'); 65 | }); 66 | div.on('show.bs.collapse', function () { 67 | showCodeText.text('Hide'); 68 | showCodeButton.addClass('btn-expanding'); 69 | }); 70 | div.on('shown.bs.collapse', function () { 71 | showCodeButton.removeClass('btn-expanding'); 72 | }); 73 | 74 | }); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /docs/site_libs/navigation-1.1/sourceembed.js: -------------------------------------------------------------------------------- 1 | 2 | window.initializeSourceEmbed = function(filename) { 3 | $("#rmd-download-source").click(function() { 4 | var src = $("#rmd-source-code").html(); 5 | var a = document.createElement('a'); 6 | a.href = "data:text/x-r-markdown;base64," + src; 7 | a.download = filename; 8 | document.body.appendChild(a); 9 | a.click(); 10 | document.body.removeChild(a); 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /docs/site_libs/navigation-1.1/tabsets.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /** 4 | * jQuery Plugin: Sticky Tabs 5 | * 6 | * @author Aidan Lister 7 | * adapted by Ruben Arslan to activate parent tabs too 8 | * http://www.aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/ 9 | */ 10 | (function($) { 11 | "use strict"; 12 | $.fn.rmarkdownStickyTabs = function() { 13 | var context = this; 14 | // Show the tab corresponding with the hash in the URL, or the first tab 15 | var showStuffFromHash = function() { 16 | var hash = window.location.hash; 17 | var selector = hash ? 'a[href="' + hash + '"]' : 'li.active > a'; 18 | var $selector = $(selector, context); 19 | if($selector.data('toggle') === "tab") { 20 | $selector.tab('show'); 21 | // walk up the ancestors of this element, show any hidden tabs 22 | $selector.parents('.section.tabset').each(function(i, elm) { 23 | var link = $('a[href="#' + $(elm).attr('id') + '"]'); 24 | if(link.data('toggle') === "tab") { 25 | link.tab("show"); 26 | } 27 | }); 28 | } 29 | }; 30 | 31 | 32 | // Set the correct tab when the page loads 33 | showStuffFromHash(context); 34 | 35 | // Set the correct tab when a user uses their back/forward button 36 | $(window).on('hashchange', function() { 37 | showStuffFromHash(context); 38 | }); 39 | 40 | // Change the URL when tabs are clicked 41 | $('a', context).on('click', function(e) { 42 | history.pushState(null, null, this.href); 43 | showStuffFromHash(context); 44 | }); 45 | 46 | return this; 47 | }; 48 | }(jQuery)); 49 | 50 | window.buildTabsets = function(tocID) { 51 | 52 | // build a tabset from a section div with the .tabset class 53 | function buildTabset(tabset) { 54 | 55 | // check for fade and pills options 56 | var fade = tabset.hasClass("tabset-fade"); 57 | var pills = tabset.hasClass("tabset-pills"); 58 | var navClass = pills ? "nav-pills" : "nav-tabs"; 59 | 60 | // determine the heading level of the tabset and tabs 61 | var match = tabset.attr('class').match(/level(\d) /); 62 | if (match === null) 63 | return; 64 | var tabsetLevel = Number(match[1]); 65 | var tabLevel = tabsetLevel + 1; 66 | 67 | // find all subheadings immediately below 68 | var tabs = tabset.find("div.section.level" + tabLevel); 69 | if (!tabs.length) 70 | return; 71 | 72 | // create tablist and tab-content elements 73 | var tabList = $(''); 74 | $(tabs[0]).before(tabList); 75 | var tabContent = $('
'); 76 | $(tabs[0]).before(tabContent); 77 | 78 | // build the tabset 79 | var activeTab = 0; 80 | tabs.each(function(i) { 81 | 82 | // get the tab div 83 | var tab = $(tabs[i]); 84 | 85 | // get the id then sanitize it for use with bootstrap tabs 86 | var id = tab.attr('id'); 87 | 88 | // see if this is marked as the active tab 89 | if (tab.hasClass('active')) 90 | activeTab = i; 91 | 92 | // remove any table of contents entries associated with 93 | // this ID (since we'll be removing the heading element) 94 | $("div#" + tocID + " li a[href='#" + id + "']").parent().remove(); 95 | 96 | // sanitize the id for use with bootstrap tabs 97 | id = id.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_'); 98 | tab.attr('id', id); 99 | 100 | // get the heading element within it, grab it's text, then remove it 101 | var heading = tab.find('h' + tabLevel + ':first'); 102 | var headingText = heading.html(); 103 | heading.remove(); 104 | 105 | // build and append the tab list item 106 | var a = $('' + headingText + ''); 107 | a.attr('href', '#' + id); 108 | a.attr('aria-controls', id); 109 | var li = $('
  • '); 110 | li.append(a); 111 | tabList.append(li); 112 | 113 | // set it's attributes 114 | tab.attr('role', 'tabpanel'); 115 | tab.addClass('tab-pane'); 116 | tab.addClass('tabbed-pane'); 117 | if (fade) 118 | tab.addClass('fade'); 119 | 120 | // move it into the tab content div 121 | tab.detach().appendTo(tabContent); 122 | }); 123 | 124 | // set active tab 125 | $(tabList.children('li')[activeTab]).addClass('active'); 126 | var active = $(tabContent.children('div.section')[activeTab]); 127 | active.addClass('active'); 128 | if (fade) 129 | active.addClass('in'); 130 | 131 | if (tabset.hasClass("tabset-sticky")) 132 | tabset.rmarkdownStickyTabs(); 133 | } 134 | 135 | // convert section divs with the .tabset class to tabsets 136 | var tabsets = $("div.section.tabset"); 137 | tabsets.each(function(i) { 138 | buildTabset($(tabsets[i])); 139 | }); 140 | }; 141 | 142 | -------------------------------------------------------------------------------- /docs/site_libs/tocify-1.9.1/jquery.tocify.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.tocify.css 1.9.1 3 | * Author: @gregfranko 4 | */ 5 | 6 | /* The Table of Contents container element */ 7 | .tocify { 8 | width: 20%; 9 | max-height: 90%; 10 | overflow: auto; 11 | margin-left: 2%; 12 | position: fixed; 13 | border: 1px solid #ccc; 14 | border-radius: 6px; 15 | } 16 | 17 | /* The Table of Contents is composed of multiple nested unordered lists. These styles remove the default styling of an unordered list because it is ugly. */ 18 | .tocify ul, .tocify li { 19 | list-style: none; 20 | margin: 0; 21 | padding: 0; 22 | border: none; 23 | line-height: 30px; 24 | } 25 | 26 | /* Top level header elements */ 27 | .tocify-header { 28 | text-indent: 10px; 29 | } 30 | 31 | /* Top level subheader elements. These are the first nested items underneath a header element. */ 32 | .tocify-subheader { 33 | text-indent: 20px; 34 | display: none; 35 | } 36 | 37 | /* Makes the font smaller for all subheader elements. */ 38 | .tocify-subheader li { 39 | font-size: 12px; 40 | } 41 | 42 | /* Further indents second level subheader elements. */ 43 | .tocify-subheader .tocify-subheader { 44 | text-indent: 30px; 45 | } 46 | .tocify-subheader .tocify-subheader .tocify-subheader { 47 | text-indent: 40px; 48 | } 49 | .tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader { 50 | text-indent: 50px; 51 | } 52 | .tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader { 53 | text-indent: 60px; 54 | } 55 | 56 | /* Twitter Bootstrap Override Style */ 57 | .tocify .tocify-item > a, .tocify .nav-list .nav-header { 58 | margin: 0px; 59 | } 60 | 61 | /* Twitter Bootstrap Override Styles */ 62 | .tocify .tocify-item a, .tocify .list-group-item { 63 | padding: 5px; 64 | } 65 | 66 | .tocify .nav-pills > li { 67 | float: none; 68 | } 69 | 70 | /* We don't override the bootstrap colors because this gives us the 71 | wrong selection colors when using bootstrap themes 72 | 73 | .tocify .list-group-item:hover, .tocify .list-group-item:focus { 74 | background-color: #f5f5f5; 75 | } 76 | 77 | .tocify .list-group-item.active:hover, .tocify .list-group-item.active:focus { 78 | background-color: #428bca; 79 | } 80 | */ 81 | 82 | /* End Twitter Bootstrap Override Styles */ 83 | -------------------------------------------------------------------------------- /docs_old/_config.yml: -------------------------------------------------------------------------------- 1 | title: infomapecology 2 | description: A package for running Infomap, inspired by ecological networks 3 | url: https://ecological-complexity-lab.github.io/infomap_ecology_package/ 4 | 5 | theme: jekyll-theme-cayman 6 | toc: true 7 | -------------------------------------------------------------------------------- /docs_old/bipartite.md: -------------------------------------------------------------------------------- 1 | # Bipartite monolayer network example 2 | 3 | ### Data set 4 | A weighted bipartite network describing a plant-flower visitor interaction web (25 plant species and 79 flower visitor species) in the vicinity of Bristol, U.K. To distinguish between the two node sets we number the pollinator species from 1-79 and the plants from 80-104. Data can be obtained using `data(memmott1999)` using package `bipartite` in `R`. 5 | 6 | ### Input 7 | A [link list](https://www.mapequation.org/infomap/#InputLinkList) with columns `from`, `to` and `weight`. Because this is a bipartite network the `from` column can only contain nodes 1-79 and the `to` column nodes 84-104. 8 | 9 | ### R Code 10 | ```R 11 | # Import data 12 | library(bipartite) 13 | data(memmott1999) 14 | 15 | network_object <- create_monolayer_network(memmott1999, bipartite = T, directed = F, group_names = c('A','P')) 16 | infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 17 | flow_model = 'undirected', 18 | silent=T, trials=20, two_level=T, seed=123) 19 | 20 | # Plot the matrix (plotting function in beta) 21 | plot_modular_matrix(infomap_object) 22 | ``` 23 | 24 | ### Infomap 25 | Under the hood, the function `run_infomap_monolayer` runs: 26 | 27 | ```C++ 28 | ./Infomap infomap.txt . --tree -i link-list --seed 123 -N 20 -f undirected -2 29 | ``` 30 | 31 | With this command, Infomap detects modules that contain both plants and pollinators. 32 | * `-f undirected` indicates flow on an undirected network. 33 | * `-2` indicates a two-level solution, with no hierarchical modules. 34 | 35 | 36 | ### Output 37 | A [tree file](https://www.mapequation.org/infomap/#OutputTree) is produced by Infomap, but is parsed by `run_infomap_monolayer` from infomapecology (in R: `?run_infomap_monolayer`). 38 | -------------------------------------------------------------------------------- /docs_old/flows.md: -------------------------------------------------------------------------------- 1 | # Flow models 2 | 3 | ### Data set 4 | Weighted directed networks of pollen transfer from [Tur C, Sáez A, Traveset A, Aizen MA. Evaluating the effects of pollinator-mediated interactions using pollen transfer networks: evidence of widespread facilitation in south Andean plant communities. Ecol Lett. 2016;19: 576–586](https://onlinelibrary.wiley.com/doi/abs/10.1111/ele.12594). 5 | 6 | ### Input 7 | A [link-list](https://www.mapequation.org/infomap/#InputLinkList). 8 | 9 | ### R Code 10 | ```R 11 | # Import data 12 | data(tur2016) 13 | tur2016_altitude2000 <- tur2016 %>% 14 | filter(altitude==2000) %>% 15 | select("donor", "receptor", "total") %>% 16 | group_by(donor, receptor) %>% 17 | summarise(n=mean(total)) %>% 18 | rename(from = donor, to = receptor, weight = n) %>% 19 | ungroup() %>% 20 | slice(c(-10,-13,-28)) %>% # Remove singletons 21 | filter(from!=to) # Remove self loops 22 | 23 | network_object <- create_monolayer_network(tur2016_altitude2000, 24 | directed = T, bipartite = F) 25 | res_dir <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 26 | flow_model = 'directed', 27 | silent=T,trials=100, two_level=T, seed=200952) 28 | res_rawdir <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 29 | flow_model = 'rawdir', 30 | silent=T,trials=100, two_level=T, seed=200952) 31 | 32 | res_dir_modules <- res_dir$modules %>% drop_na() 33 | res_rawdir_modules <- res_rawdir$modules %>% drop_na() 34 | 35 | 36 | # Compare the results using normalised mutual information 37 | N <- res_dir_modules %>% # Create confusion matrix 38 | select(-module_level2) %>% 39 | inner_join(res_rawdir_modules %>% select(node_id,module_level1), by='node_id') %>% 40 | arrange(module_level1.x,module_level1.y) %>% 41 | group_by(module_level1.y) %>% select(module_level1.x) %>% table() 42 | 43 | # These two different modes of flow can result in different partitions. 44 | NMI(N) 45 | 46 | ``` 47 | 48 | ### Infomap 49 | Under the hood, the function `run_infomap_monolayer` runs: 50 | 51 | For **real measured** flows: 52 | ```C++ 53 | ./Infomap infomap.txt . -i link-list --tree --seed 200952 -N 100 -f rawdir --two-level 54 | ``` 55 | 56 | For **constraints** on flows: 57 | ```C++ 58 | ./Infomap infomap.txt . -i link-list --tree --seed 200952 -N 100 -f directed --two-level 59 | ``` 60 | 61 | Explanation of key arguments: 62 | * `-f directed` indicates flow on a directed network. The visitation rates of nodes is obtained with a PageRank algorithm based on the direction and weight of edges. 63 | * `-f rawdir` or `-f directed`: In a `rawdir` flow model the visitation rates of nodes is determined without a PageRank algorithm but rather by the given direction and weight of edges. In a `directed` flow model edge weights are assumed to be constraints on flow, and a PageRank algorithm is run first to determine flow. 64 | 65 | 66 | ### Output 67 | A [tree file](https://www.mapequation.org/infomap/#OutputTree) is produced by Infomap, but is parsed by `run_infomap_monolayer` from infomapecology (in R: `?run_infomap_monolayer`). 68 | -------------------------------------------------------------------------------- /docs_old/index.md: -------------------------------------------------------------------------------- 1 | **Updated: 2021-09-26** 2 | 3 | This site is an extension of the paper [Identifying flow modules in ecological networks using Infomap](https://onlinelibrary.wiley.com/doi/10.1111/2041-210X.13569) It contains installation instructions and very detailed Infomap commands and R code that we use in the examples that are presented in the paper. Infomap is a very rich implementation of the map equation, fully covered in [https://www.mapequation.org/](https://www.mapequation.org/). In this knowledge base we present what is most relevant for ecological network analysis and the R package `infomapecology`. The package is a convenient interface to use Infomap within R and to santdardize network data structures for a better workflow with other package such as igraph and bipartite. We will be updating this knowledge base with every improvement of `infomapecology`. 4 | 5 | # Installation of Infomap and infomapecology 6 | Currently, infomapecology uses a standalone version of Infomap. We are working hard to integrate Infomap directly into R. Until that happens, install Infomap and infomapecology as specified [here](https://ecological-complexity-lab.github.io/infomap_ecology_package/installation). 7 | 8 | # Infomap's basics 9 | The basics of Infomap's input and output are [here](https://ecological-complexity-lab.github.io/infomap_ecology_package/infomapbasics). 10 | 11 | # Examples from the paper 12 | 13 | * [Bipartite monolayer network example](https://ecological-complexity-lab.github.io/infomap_ecology_package/bipartite) 14 | * [Monolayer directed network with hierarchical structure](https://ecological-complexity-lab.github.io/infomap_ecology_package/monolayer_heirarchical) 15 | * [Monolayer directed network with node attributes](https://ecological-complexity-lab.github.io/infomap_ecology_package/monolayer_node_attributes) 16 | * [Flow models](https://ecological-complexity-lab.github.io/infomap_ecology_package/flows) 17 | * [Hypothesis testing](https://ecological-complexity-lab.github.io/infomap_ecology_package/hypothesis_test) 18 | * [Temporal multilayer network with global relax rates](https://ecological-complexity-lab.github.io/infomap_ecology_package/multilayer_relax) 19 | * [Temporal multilayer network with interlayer edges](https://ecological-complexity-lab.github.io/infomap_ecology_package/multilayer_interlayer) 20 | 21 | ## Acknowledgements 22 | This work was supported by research grant ISF (Israel Science Foundation) 1281/20 to Shai Pilosof. 23 | -------------------------------------------------------------------------------- /docs_old/infomapbasics.md: -------------------------------------------------------------------------------- 1 | # Infomap arguments 2 | Most of the Infomap arguments we use are common for all the examples and their detailed description can be found [here](https://www.mapequation.org/infomap/#Parameters). We explain in each example the most relevant specific arguments. Here is a typical running command: 3 | 4 | `./Infomap infomap.txt . --tree -i link-list --seed 123 -N 20 -f undirected -2`. 5 | 6 | * `infomap.txt` is the name of the input file 7 | * `.` indicates that the output will be written to the same folder as the input file. 8 | * `--tree` sets the output format. 9 | * `-i link-list` indicates that the input is a [link list](https://www.mapequation.org/infomap/#InputLinkList). 10 | * `--seed 123` provides a seed to the random number generator such that each run will result in the same output, which is useful for replication. 11 | * `-N 20` tells infomap to run 20 trials and select the result of the best one. 12 | * `-f undirected` indicates flow on an undirected network. 13 | * `-2` indicates a two-level solution, with no hierarchical modules (modules within modules). 14 | 15 | # Infomap output 16 | The output, written into the `tree` file, is as follows (details [here](https://www.mapequation.org/infomap/#Output)). 17 | ```python 18 | # v1.0.6 19 | # ./Infomap infomap.txt . -i link-list --out-name infomap_out --tree --seed 123 -N 20 -f undirected --silent --two-level 20 | # started at 2020-03-11 14:24:12 21 | # completed in 0.0300386 s 22 | # codelength 4.565 bits 23 | # relative codelength savings 2.4337% 24 | # path flow name node_id 25 | 1:1 0.00091617 "1" 1 26 | 1:2 0.00229043 "7" 7 27 | 1:3 0.00114521 "8" 8 28 | 1:4 0.00091617 "10" 10 29 | 1:5 0.000458085 "11" 11 30 | ``` 31 | The first four lines are quite obvious. The 5th line provides the value of the map equations objective function (_L_) for the optimal partition. After the headings, rows describe module affiliation and flow. The `path` column is a tree-like format. The last integer after the colon indicates the ID of the leaf in the module, and not the ID of the node. See detailed explanations also in the R function (`run_infomap_monolayer`) in the package, which automatically reads this output and adds the affiliation of modules to the node table to create an output similar to this: 32 | 33 | ```python 34 | node_id node_name module_level1 module_level2 node_type node_group 35 | 1 1 Aglais.urticae 1 1 c A 36 | 2 2 Apis.mellifera 2 1 c A 37 | 3 3 Bombus.lapidarius 2 2 c A 38 | 4 4 Bombus.muscorum 3 1 c A 39 | 5 5 Bombus.pascuorum 3 2 c A 40 | 6 6 Bombus.terrestris 2 3 c A 41 | ``` 42 | 43 | Here, `module_level1` is the module ID and `module_level2` is the leaf ID, extracted from the `path` column. `node_type` is either `c` for column or `r` for row, indicating of the node appears in the column or row of the matrix format. 44 | -------------------------------------------------------------------------------- /docs_old/installation.md: -------------------------------------------------------------------------------- 1 | ## 1. Install the R package 2 | The package was built under R 4.1 and depends on other packages. 3 | 4 | ```R 5 | # Install (if not installed) and load necessary packages 6 | package.list=c("attempt", "cowplot", "igraph", "ggalluvial","magrittr","metafolio","tidyverse","vegan", "devtools") 7 | loaded <- package.list %in% .packages() 8 | package.list <- package.list[!loaded] 9 | installed <- package.list %in% .packages(TRUE) 10 | if (!all(installed)) install.packages(package.list[!installed], repos="http://cran.rstudio.com/") 11 | 12 | # Install infomapecology 13 | devtools::install_github('Ecological-Complexity-Lab/infomap_ecology_package', force=T) 14 | library(infomapecology) 15 | 16 | # Check the version. 17 | packageDescription('infomapecology') 18 | ``` 19 | 20 | ## 2. Install Infomap 21 | We use Infomap version 1.x as a stand-alone file. Future versions (or a different package) will integrate Infomap directly intro R. 22 | 23 | ### MacOS (Linux should be similar) 24 | #### 1. In the terminal run: 25 | * `xcode-select --install` 26 | * For OpenMP support 27 | * Install homebrew as specified in [https://brew.sh](https://brew.sh). This will take a while. 28 | * install packages: `brew install libomp`. 29 | 30 | #### 2. Then either: 31 | Install Infomap via the `install_infomap` function in the package as below. Avoid folder names with spaces or non-english lettes. 32 | 33 | ```R 34 | setwd('where your Infomap file and R script will live') 35 | install_infomap() 36 | 37 | # Check Infomap is running 38 | setwd('where your Infomap file and R script now live') 39 | check_infomap() # Make sure file can be run correctly. Should return TRUE 40 | ``` 41 | 42 | or download a binary from [here](https://github.com/mapequation/infomap/releases/latest) and put the file in the working folder. 43 | 44 | 45 | ### Windows 46 | 47 | Install Infomap via the `install_infomap` function in the package as below. Avoid folder names with spaces or non-english lettes. 48 | 49 | ```R 50 | setwd('where your Infomap file and R script will live') 51 | install_infomap() 52 | 53 | # Check Infomap is running 54 | setwd('where your Infomap file and R script now live') 55 | check_infomap() # Make sure file can be run correctly. Should return TRUE 56 | ``` 57 | 58 | or download a binary from [here](https://github.com/mapequation/infomap/releases/latest) and put the file in the working folder. 59 | 60 | 61 | **Important notes:** 62 | 1. The best practice is to compile Infomap under the file name "Infomap" and place it in the 63 | same working folder in which the R code is run. 64 | 2. Other ways to install: [https://www.mapequation.org/infomap/#Install](https://www.mapequation.org/infomap/#Install) 65 | -------------------------------------------------------------------------------- /docs_old/multilayer_relax.md: -------------------------------------------------------------------------------- 1 | # Temporal multilayer network with global relax rates 2 | 3 | ### Data set 4 | A temporal multilayer network. Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer edges are ignored. This data set was taken from [_Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101_](https://www.nature.com/articles/s41559-017-0101?proof=true19). 5 | 6 | Data sets in infomapecology: 7 | ```R 8 | # Get data 9 | data("siberia1982_7_links") 10 | data("siberia1982_7_nodes") 11 | ``` 12 | ### Input 13 | A [multilayer link-list format](https://www.mapequation.org/infomap/#InputMultilayer). With this format, a random walker moves within a layer and with a given relax rate _r_ jumps to another layer without recording this movement, such that the constraints from moving in different layers can be gradually relaxed. If the `*Inter` exists, then interlayer edges can be used. However, if a relax rate is also used (Infomap input parameter `--multilayer-relax-rate`), the interlayer edges are ignored. Here we only include `*Intra`. 14 | 15 | ```Python 16 | # A network in multilayer format 17 | *Intra 18 | #layer node node weight 19 | 1 1 23 0.15853658536585366 20 | 1 1 25 0.024390243902439025 21 | 1 1 27 0.0975609756097561 22 | ... some more cases ... 23 | 6 22 63 0.8181818181818182 24 | 6 22 67 0.09090909090909091 25 | 6 22 77 0.18181818181818182 26 | ``` 27 | 28 | ### R Code 29 | The description of functions `create_multilayer_object` and `run_infomap_multilayer` in the `infomapecology` package contains everything you need to know. The `for` loop performs a sensitivity analysis to examine how structure changes with increasing relax rates. 30 | 31 | ```R 32 | # Create a multilayer object 33 | NEE2017 <- create_multilayer_object(extended = siberia1982_7_links, nodes = siberia1982_7_nodes, intra_output_extended = F) 34 | 35 | # Ignore interlayer edges 36 | NEE2017$inter <- NULL 37 | 38 | #Run Infomap and return the network's modular structure at increasing relax-rates. 39 | relaxrate_modules <- NULL 40 | for (r in seq(0.001,1, by = 0.0999)){ 41 | print(r) 42 | modules_relax_rate <- run_infomap_multilayer(NEE2017, relax = T, silent = T, trials = 50, seed = 497294, multilayer_relax_rate = r, multilayer_relax_limit_up = 1, multilayer_relax_limit_down = 0, temporal_network = T) 43 | modules_relax_rate$modules$relax_rate <- r 44 | relaxrate_modules <- rbind(relaxrate_modules, modules_relax_rate$modules) 45 | } 46 | ``` 47 | 48 | ### Infomap 49 | Under the hood, the function `run_infomap_multilayer` runs: 50 | ```C++ 51 | ./Infomap infomap_multilayer.txt . -2 --seed 497294 -N 50 -i multilayer --multilayer-relax-rate 0.15 --multilayer-relax-limit-up 1 --multilayer-relax-limit-down 0 --silent 52 | ``` 53 | 54 | Explanation of key arguments: 55 | * `-i multilayer` indicates a multilayer input format, which is automatically recognized as a multilayer link list (and not as a general link list). 56 | * `--multilayer-relax-rate 0.15` defines the relax rate (here 0.15). 57 | * `multilayer-relax-limit-up 1 --multilayer-relax-limit-down 0` limits relaxation to a single layer upwards (l to l+1), but never downwards, because time flows one-way. 58 | 59 | ### Output 60 | For multilayer network the output file has a `_states` suffix, with the following format. This output is as in [Temporal multilayer network with interlayer edges](multilayer_interlayer.md). 61 | 62 | ```R 63 | # path flow name stateId physicalId layerId 64 | 1:1 0.000516265 "0" 0 1 1 65 | 1:2 0.000211504 "8" 8 44 1 66 | 1:3 0.000225137 "19" 19 75 1 67 | 1:4 0.000124064 "20" 20 76 1 68 | ``` 69 | This output is parsed by `run_infomap_multilayer` to obtain a table in which each state node (combination of a physical node in a layer) is assigned to a module. This can be obtained by (after running the code above): 70 | ```R 71 | relaxrate_modules$modules 72 | ``` 73 | -------------------------------------------------------------------------------- /infomap_ecology_package.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | PackageCheckArgs: --as-cran 19 | -------------------------------------------------------------------------------- /man/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/man/.DS_Store -------------------------------------------------------------------------------- /man/NMI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMI.R 3 | \name{NMI} 4 | \alias{NMI} 5 | \title{Normalized mutual information} 6 | \usage{ 7 | NMI(N) 8 | } 9 | \arguments{ 10 | \item{N}{A confusion matrix.} 11 | } 12 | \value{ 13 | Value between 0 (no mutual information) to 1 (complete mutual 14 | information). 15 | } 16 | \description{ 17 | Calculate normalized mutual information based on a confusion matrix. Very 18 | useful for comparing between two partition structures of a network. 19 | } 20 | \details{ 21 | If the partitions are exactly the same then all the nodes that 22 | appear in a given module in the first network will also appear in the same 23 | module in the second network. In this case, the confusion matrix will have 24 | all the values on the diagonal, and NMI=1. 25 | } 26 | \examples{ 27 | # Generate a confusion martrix for a network with 50 modules. 28 | # Partition A has 6 modules (rows), partition B has 5 (columns). 29 | # Each cell in N indicates the number of nodes that were assigned 30 | # together to a module in A and B. For example, 5 nodes were assigned 31 | # to module 2 in partition A and to module 1 in partition B. 32 | N <- matrix(0,6,5) 33 | diag(N[-1,])<-c(5,2,6,5,5) 34 | diag(N) <- c(4,4,6,5,5) 35 | N[6,1] <- 2 36 | N[1,4] <- 1 37 | NMI(N) 38 | 39 | # An example of perfect information (exact same partitions): 40 | N <- matrix(0,5,5) 41 | diag(N) <- c(10,15,10,12,3) 42 | NMI(N) # Should be 1 43 | 44 | } 45 | \references{ 46 | Danon L, Díaz-Guilera A, Duch J, Arenas A. Comparing community 47 | structure identification. J Stat Mech. 2005;2005: P09008. 48 | 49 | Guimerà R, Sales-Pardo M, Amaral LAN. Module identification in 50 | bipartite and directed networks. Phys Rev E Stat Nonlin Soft Matter Phys. 51 | 2007;76: 036102. 52 | 53 | Pilosof S, Fortuna MA, Cosson J-FC, Galan M, Kittipong C, Ribas 54 | A, et al. Host-parasite network structure is associated with 55 | community-level immunogenetic diversity. Nat Commun. 2014;5: 5172. 56 | } 57 | -------------------------------------------------------------------------------- /man/check_infomap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/check_infomap.R 3 | \name{check_infomap} 4 | \alias{check_infomap} 5 | \title{Check if Infomap's standalone file is installed.} 6 | \usage{ 7 | check_infomap(x = "Infomap") 8 | } 9 | \arguments{ 10 | \item{x}{The name of the Infomap executable file.} 11 | } 12 | \value{ 13 | FALSE and an error if Infomap is not installed correctly. TRUE (and version number) if it is. 14 | } 15 | \description{ 16 | Attempts to run Infomap via the \code{system} command to make sure it works propoerly. 17 | } 18 | \details{ 19 | For now, this package depends on Infomap's stand-alone version. Futre versions or another package will incorporate Infomap directly into R. 20 | } 21 | \examples{ 22 | check_infomap() 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/create_infomap_linklist.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/create_infomap_linklist.R 3 | \name{create_infomap_linklist} 4 | \alias{create_infomap_linklist} 5 | \title{Create a link list for Infomap} 6 | \usage{ 7 | create_infomap_linklist( 8 | x, 9 | make_directed = F, 10 | write_to_file = F, 11 | output_file = "infomap_link_list.txt" 12 | ) 13 | } 14 | \arguments{ 15 | \item{x}{A monolayer object created with \code{create_monolayer_network}.} 16 | 17 | \item{make_directed}{for undirected networks, create two sets of edges.} 18 | 19 | \item{write_to_file}{write the link list into a file?} 20 | 21 | \item{output_file}{the name of the output file (default is 'infomap_link_list.txt')} 22 | } 23 | \value{ 24 | An object of class \code{infomap_link_list}, which is an R list with: 25 | \itemize{ 26 | \item \code{edge_list_infomap} A link list (format: from, to, weight) formatted for Infomap, with node IDs 27 | \item \code{nodes} A tibble with node IDs, names and possibly other attributes. 28 | } 29 | } 30 | \description{ 31 | Takes a monolayer object and returns a link list and a tibble with nodes. 32 | } 33 | \details{ 34 | Used internally by \code{run_infomap_monolayer}, but also useful for writing the link list to a file. 35 | } 36 | \examples{ 37 | network_object <- create_monolayer_network(bipartite::memmott1999, 38 | bipartite = TRUE, directed = FALSE, group_names = c('A','P')) 39 | 40 | x <- create_infomap_linklist(network_object, make_directed = FALSE, 41 | write_to_file = FALSE) 42 | 43 | } 44 | \seealso{ 45 | \code{infomap_link_list} 46 | } 47 | -------------------------------------------------------------------------------- /man/gg_color_hue.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gg_color_hue.R 3 | \name{gg_color_hue} 4 | \alias{gg_color_hue} 5 | \title{Generate colors for ggplot} 6 | \usage{ 7 | gg_color_hue(n, hue_min = 10, hue_max = 280, tune1 = 62, tune2 = 100) 8 | } 9 | \arguments{ 10 | \item{n}{See package metafolio} 11 | 12 | \item{hue_min}{See package metafolio} 13 | 14 | \item{hue_max}{See package metafolio} 15 | 16 | \item{tune1}{See package metafolio} 17 | 18 | \item{tune2}{See package metafolio} 19 | } 20 | \description{ 21 | Generate colors for ggplot 22 | } 23 | \details{ 24 | Taken from package metafolio. See details there 25 | } 26 | -------------------------------------------------------------------------------- /man/infomap_link_list.Rd: -------------------------------------------------------------------------------- 1 | \name{infomap link list class} 2 | \alias{infomap_link_list} 3 | \title{An object of class infomap_link_list} 4 | 5 | \value{ 6 | An R list with: 7 | \itemize{ 8 | \item \code{edge_list_infomap} A link list (format: from, to, weight) formatted for Infomap, with node IDs 9 | \item \code{nodes} A tibble with node IDs, names and possibly other attributes. 10 | } 11 | } 12 | \description{ 13 | A network object of class infomap_link_list contains all the necessary information and R objects to run Infomap and parse the results back to R. 14 | } 15 | \seealso{ 16 | \code{create_infomap_linklist} 17 | } -------------------------------------------------------------------------------- /man/infomap_monolayer.Rd: -------------------------------------------------------------------------------- 1 | \name{infomap_monolayer class} 2 | \alias{infomap} 3 | \title{An object of class infomap_monolayer} 4 | 5 | \value{ 6 | A list with: 7 | \itemize{ 8 | \item \code{call} The call to Infomap with all the arguments. 9 | \item \code{L} The value of the map equation for the observed network. 10 | \item \code{m} The number of top modules for the observed network. 11 | \item \code{modules} A tibble with node id, module affiliations and node attributes if they exist. 12 | \item \code{edge_list} The original edge list (network). 13 | \item \code{L_sim} A vector with values of L for the shuffled network, with length as the number 14 | \item \code{m_sim} A vector with the number of modules for the shuffled network, with length as the numberof randomizations. \code{NULL} if significance test was not performed. 15 | \item \code{pvalue} P value of comparison to randomizations. \code{NULL} if significance test was not performed. 16 | } 17 | } 18 | \description{ 19 | An object of class infomap_monolayer contains all the information resulting from an analysis of modularity. It facilitates subsequernt analyses and plotting. 20 | } 21 | \seealso{ 22 | \code{run_infomap_monolayer} 23 | } 24 | 25 | -------------------------------------------------------------------------------- /man/infomap_multilayer.Rd: -------------------------------------------------------------------------------- 1 | \name{infomap multilayer class} 2 | \alias{infomap multilayer} 3 | \title{An object of class infomap_multilayer} 4 | 5 | \value{ 6 | A list with: 7 | \itemize{ 8 | \item \code{call} The call to Infomap with all the arguments. 9 | \item \code{L} The value of the map equation. 10 | \item \code{m} Number of modules. 11 | \item \code{modules} A tibble with nodes, their module affiliations, and node attributes. } 12 | } 13 | 14 | \description{ 15 | An object of class infomap_multialyer contains all the information resulting from an analysis of modularity on multilayer networks. It facilitates subsequernt analyses and plotting. 16 | } 17 | \seealso{ 18 | \code{run_infomap_multilayer} 19 | } 20 | 21 | -------------------------------------------------------------------------------- /man/infomapecology.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/infomapecology.R 3 | \docType{package} 4 | \name{infomapecology} 5 | \alias{infomapecology} 6 | \title{infomapecology: A package for running Infomap, inspired by ecological networks} 7 | \description{ 8 | The package contains functions that prepare monolayer and multilayer networks 9 | for analysis with Infomap, run Infomap from within R and parse the results 10 | back to R. Also includes standardized objects to store and further analyze 11 | monolayer and multilayer networks. The package is inspired by analysis of 12 | ecological networks but is suitable for other areas of research as well. 13 | } 14 | \details{ 15 | We use Infomap as a stand-alone file. Future versions will integrate Infomap 16 | directly into R. Complete instructions on how to download, install and use 17 | Infomap can be found in 18 | \href{https://www.mapequation.org}{https://www.mapequation.org}. The best 19 | practice is to compile Infomap under the file name Infomap and place it in the 20 | same working folder in which the R code is run. See details in \href{https://ecological-complexity-lab.github.io/infomap_ecology_package/installation}{https://ecological-complexity-lab.github.io/infomap_ecology_package/installation} 21 | 22 | The package also includes several data sets of ecological networks. 23 | 24 | Ideas/requests for features are welcome (open an issue 25 | \href{https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues}{https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues}). 26 | } 27 | \references{ 28 | Farage C, Edler D, Eklöf A, Rosvall M, Pilosof S. Identifying flow 29 | modules in ecological networks using Infomap. Methods in Ecology and 30 | Evolution 2021. doi:10.1111/2041‐210X.13569 31 | } 32 | \author{ 33 | Shai Pilosof 34 | } 35 | -------------------------------------------------------------------------------- /man/install_infomap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/install_infomap.R 3 | \name{install_infomap} 4 | \alias{install_infomap} 5 | \title{A wrapper to install Infomap's standalone file.} 6 | \usage{ 7 | install_infomap(target_folder = NULL, source = "binary", version = "2.7.1") 8 | } 9 | \arguments{ 10 | \item{target_folder}{Where to install Infomap. Defaults to R's current 11 | working directory (\code{getwd()}). 12 | Note: avoid using special characters or spaces in the folder's path.} 13 | 14 | \item{source}{The source to download Infomap from. Relevant only for Unix based operating systems. 15 | "git" to download the latest version from development, 16 | "binary" (default) to download the latest release version.} 17 | 18 | \item{version}{The version of Infomap to install. By default, it installs version 2.7.1. 19 | Users are encouraged to check for the latest version.} 20 | } 21 | \value{ 22 | FALSE and an error if Infomap is not installed correctly. TRUE (and 23 | version number) if it is. 24 | } 25 | \description{ 26 | Downloads the latest binary release version from MapEquation according to the 27 | machine's operating system (Windows/MacOS/Linux). Unix based OS users have 28 | the option to download the latest version in development from the git. 29 | In that case it clones the GitHub repository and runs \code{make} via R's 30 | \code{system} command. This is merely a wrapper for commands that can be 31 | easily run in the terminal. 32 | } 33 | \details{ 34 | Users have the option to download the specific version by providing the argument \code{version} 35 | If \code{version} is not provided, it installs version 2.7.1. 36 | 37 | For now, this package depends on Infomap's stand-alone version. 38 | Future versions or another package will incorporate Infomap directly into R. 39 | Therefore it is necessary to install infomap in the same folder where the code is Run. 40 | If it is already installed, then it will be replaced. Check \href{https://github.com/mapequation/infomap/releases}{for a list of versions} 41 | For full instructions see \href{https://ecological-complexity-lab.github.io/infomap_ecology_package/installation}{here} 42 | } 43 | \examples{ 44 | \dontrun{ 45 | install_infomap() 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /man/kongsfjorden_links.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kongsfjorden_links-data.R 3 | \docType{data} 4 | \name{kongsfjorden_links} 5 | \alias{kongsfjorden_links} 6 | \title{Kongsfjorden food web: links} 7 | \format{ 8 | An object of class \code{data.frame} with 1544 rows and 5 columns. 9 | } 10 | \usage{ 11 | data(kongsfjorden_links) 12 | } 13 | \description{ 14 | Food web including metazoan parasites for an intertidal ecosystem in New 15 | Zealand. 16 | } 17 | \details{ 18 | The data set is included here "as is". In this network, nodes are 19 | species or taxonomical groups (e.g., Phytoplankton) and binary links 20 | represent feeding relationships. Kongsfjorden is a glacial fjord on the 21 | northwest corner of the Svalbard archipelago. It is a 30 km open fjord with 22 | no marked sill at the entrance, and with a maximum depth exceeding 300 m. 23 | The network consists of 262 species with 1,544 feeding interactions. 24 | } 25 | \examples{ 26 | data(kongsfjorden_links) 27 | } 28 | \references{ 29 | Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223. 30 | 31 | Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884. 32 | } 33 | \seealso{ 34 | \code{kongsfjorden_nodes} 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /man/kongsfjorden_nodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kongsfjorden_nodes-data.R 3 | \docType{data} 4 | \name{kongsfjorden_nodes} 5 | \alias{kongsfjorden_nodes} 6 | \title{Kongsfjorden food web: nodes} 7 | \format{ 8 | An object of class \code{data.frame} with 262 rows and 5 columns. 9 | } 10 | \usage{ 11 | data(kongsfjorden_nodes) 12 | } 13 | \description{ 14 | Food web including metazoan parasites for an intertidal ecosystem in New 15 | Zealand. 16 | } 17 | \details{ 18 | The data set is included here "as is". In this network, nodes are 19 | species or taxonomical groups (e.g., Phytoplankton) and binary links 20 | represent feeding relationships. Kongsfjorden is a glacial fjord on the 21 | northwest corner of the Svalbard archipelago. It is a 30 km open fjord with 22 | no marked sill at the entrance, and with a maximum depth exceeding 300 m. 23 | The network consists of 262 species with 1,544 feeding interactions. 24 | } 25 | \examples{ 26 | data(kongsfjorden_nodes) 27 | } 28 | \references{ 29 | Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223. 30 | 31 | Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884. 32 | } 33 | \seealso{ 34 | \code{kongsfjorden_links} 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /man/otago_links.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/otago_links-data.R 3 | \docType{data} 4 | \name{otago_links} 5 | \alias{otago_links} 6 | \title{Otago food web: links} 7 | \format{ 8 | An object of class \code{spec_tbl_df} (inherits from \code{tbl_df}, \code{tbl}, \code{data.frame}) with 1924 rows and 16 columns. 9 | } 10 | \source{ 11 | \href{https://figshare.com/collections/Food_web_including_metazoan_parasites_for_an_intertidal_ecosystem_in_New_Zealand/3304212}{Original data set on Figshare.} 12 | } 13 | \usage{ 14 | data(otago_links) 15 | } 16 | \description{ 17 | Food web including metazoan parasites for an intertidal ecosystem in New Zealand. 18 | } 19 | \details{ 20 | The data set is included here "as is". It contains metadata on nodes (see \code{otago_nodes}). 21 | The links between nodes are directed and binary. 22 | } 23 | \examples{ 24 | data(otago_links) 25 | } 26 | \references{ 27 | Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for an intertidal ecosystem in New Zealand: Ecological Archives E092-173. Ecology. 2011;92: 2006–2006. 28 | 29 | (\href{https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/11-0371.1}{Link to paper}) 30 | } 31 | \seealso{ 32 | \code{otago_nodes} 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /man/otago_nodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/otago_nodes-data.R 3 | \docType{data} 4 | \name{otago_nodes} 5 | \alias{otago_nodes} 6 | \title{Otago food web: nodes} 7 | \format{ 8 | An object of class \code{spec_tbl_df} (inherits from \code{tbl_df}, \code{tbl}, \code{data.frame}) with 180 rows and 41 columns. 9 | } 10 | \source{ 11 | \href{https://figshare.com/collections/Food_web_including_metazoan_parasites_for_an_intertidal_ecosystem_in_New_Zealand/3304212}{Original data set on Figshare.} 12 | } 13 | \usage{ 14 | data(otago_nodes) 15 | } 16 | \description{ 17 | Food web including metazoan parasites for an intertidal ecosystem in New 18 | Zealand. 19 | } 20 | \details{ 21 | The data set is included here "as is". This data set contains all the node attributes (metadata). 22 | The links between nodes. Links are in \code{otago_links} 23 | } 24 | \examples{ 25 | data(otago_nodes) 26 | } 27 | \references{ 28 | Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web 29 | including metazoan parasites for an intertidal ecosystem in New Zealand: 30 | Ecological Archives E092-173. Ecology. 2011;92: 2006–2006. 31 | 32 | (\href{https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/11-0371.1}{Link to paper}) 33 | } 34 | \seealso{ 35 | \code{otago_links} 36 | } 37 | \keyword{datasets} 38 | -------------------------------------------------------------------------------- /man/plot_modular_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_modular_matrix.R 3 | \name{plot_modular_matrix} 4 | \alias{plot_modular_matrix} 5 | \title{Plot a matrix with colored interactions by modules} 6 | \usage{ 7 | plot_modular_matrix( 8 | x, 9 | fix_coordinates = T, 10 | axes_titles = c("Set 1", "Set 2"), 11 | transpose = F, 12 | outside_module_col = "gray" 13 | ) 14 | } 15 | \arguments{ 16 | \item{x}{An object of class \code{infomap_monolayer}.} 17 | 18 | \item{fix_coordinates}{Should x and y coordinates be fixed by ggplot to 19 | create square cells.} 20 | 21 | \item{axes_titles}{Titles for axes} 22 | 23 | \item{transpose}{Option to transpose the matrix. Useful for matrices with 24 | very differnt numbers of rows and columns.} 25 | 26 | \item{outside_module_col}{Color of interactions outside modules.} 27 | } 28 | \value{ 29 | An object of class \code{ggplot}. 30 | } 31 | \description{ 32 | Plot a matrix with colored interactions by modules 33 | } 34 | \details{ 35 | Use ggplot to plot a matrix in which cells (network interactions) 36 | are colored. Interactions that fall outside the modules are colored in 37 | \code{outside_module_col} and those that fall inside the module are colored 38 | by colors automatically generated by \code{gg_color_hue} from package metafolio. 39 | } 40 | \examples{ 41 | \dontrun{ 42 | network_object <- create_monolayer_network(bipartite::memmott1999, 43 | bipartite = TRUE, directed = FALSE, group_names = c('A','P')) 44 | 45 | infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 46 | flow_model = 'undirected', 47 | silent=TRUE, trials=20, two_level=TRUE, seed=123) 48 | plot_modular_matrix(infomap_object, fix_coordinates = TRUE) 49 | } 50 | 51 | } 52 | \seealso{ 53 | \code{ggplot2, infomap_monolayer} 54 | } 55 | -------------------------------------------------------------------------------- /man/plot_multilayer_alluvial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_multilayer_alluvial.R 3 | \name{plot_multilayer_alluvial} 4 | \alias{plot_multilayer_alluvial} 5 | \title{Alluvial plot for multilayer network} 6 | \usage{ 7 | plot_multilayer_alluvial(x, module_labels = F) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class \code{infomap_multilayer}.} 11 | 12 | \item{module_labels}{Should module labels be presented} 13 | } 14 | \value{ 15 | An object of class \code{ggplot}. 16 | } 17 | \description{ 18 | Alluvial plot for multilayer network 19 | } 20 | \details{ 21 | Use ggplot and ggalluvial to plot an alluvial plot that shows the flow of nodes between modules. Very useful for temporal networks. Because the output is 22 | a ggplot object it can be further manipulated with standard ggplot2. 23 | } 24 | \examples{ 25 | \dontrun{ 26 | emln <- create_multilayer_object(extended = siberia1982_7_links, 27 | nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) 28 | 29 | emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, 30 | flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, 31 | temporal_network = TRUE) 32 | 33 | # Plot alluvial diagram 34 | plot_multilayer_alluvial(emln_modules, module_labels = FALSE) 35 | 36 | # Can also modify the plot 37 | plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+ 38 | geom_stratum(linetype='dashed', color='gray')+ 39 | scale_x_continuous(breaks=seq(0,6,1))+ 40 | scale_y_continuous(breaks=seq(0,70,5))+ 41 | labs(y='Number of species')+ 42 | theme_bw()+ 43 | theme(legend.position = "none", 44 | panel.grid = element_blank(), 45 | axis.text = element_text(color='black', size = 20), 46 | axis.title = element_text(size=20)) 47 | } 48 | 49 | } 50 | \seealso{ 51 | \code{ggplot2, ggalluvial, infomap_monolayer} 52 | } 53 | -------------------------------------------------------------------------------- /man/plot_multilayer_modules.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_multilayer_modules.R 3 | \name{plot_multilayer_modules} 4 | \alias{plot_multilayer_modules} 5 | \title{Plot modules across layers for multilayer networks} 6 | \usage{ 7 | plot_multilayer_modules(x, type = c("circle", "rectangle"), color_modules = T) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class \code{infomap_multilayer}.} 11 | 12 | \item{type}{Plot type, circles or rectangles. See details.} 13 | 14 | \item{color_modules}{Color modules? See details.} 15 | } 16 | \value{ 17 | An object of class \code{ggplot}. 18 | } 19 | \description{ 20 | Plot modules across layers for multilayer networks 21 | } 22 | \details{ 23 | Type \code{circle} plots a circle per module-layer combination, with the radius proportional 24 | to the number of nodes in the module in the layer. Type \code{rectangle} plots a bar across all the layers a module spans. Only (or mostly) relevant for temporal networks. 25 | 26 | For a circle plot, \code{color_modules} will give a different color for 27 | each module ID. For a rectangle plot, \code{color_modules} will color each 28 | module by the total number of nodes it contains (not per layer). 29 | 30 | Because the output is a ggplot object it can be further manipulated with standard 31 | ggplot2. 32 | } 33 | \examples{ 34 | \dontrun{ 35 | emln <- create_multilayer_object(extended = siberia1982_7_links, 36 | nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) 37 | 38 | emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, 39 | flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, 40 | temporal_network = TRUE) 41 | 42 | plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ 43 | scale_fill_viridis_c() 44 | plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = FALSE)+ 45 | geom_rect(fill='orange') 46 | 47 | # Circle-type plot 48 | plot_multilayer_modules(emln_modules, type = 'circle', color_modules = TRUE) 49 | 50 | plot_multilayer_modules(emln_modules, type = 'circle', color_modules = FALSE)+ 51 | geom_point(aes(size=size), color='navy') 52 | 53 | # More examples to modify the plots 54 | plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ 55 | scale_fill_viridis_c()+ 56 | scale_x_continuous(breaks=seq(0,6,1))+ 57 | scale_y_continuous(breaks=seq(0,40,5))+ 58 | theme_bw()+ 59 | theme(panel.grid.major = element_blank(), 60 | panel.grid.minor = element_blank(), 61 | axis.title = element_text(size=20), 62 | axis.text = element_text(size = 20), 63 | legend.text = element_text(size=15), 64 | legend.title = element_text(size=20)) 65 | } 66 | 67 | } 68 | \references{ 69 | Code was first developed for: Pilosof, S., Q. He, K. E. Tiedje, 70 | S. Ruybal-Pesántez, K. P. Day, and M. Pascual. 2019. Competition for hosts 71 | modulates vast antigenic diversity to generate persistent strain structure 72 | in Plasmodium falciparum. PLoS biology 17:e3000336. 73 | } 74 | \seealso{ 75 | \code{ggplot2, infomap_monolayer} 76 | } 77 | -------------------------------------------------------------------------------- /man/plot_signif.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_signif.R 3 | \name{plot_signif} 4 | \alias{plot_signif} 5 | \title{Plot histograms for randomizations} 6 | \usage{ 7 | plot_signif(x, colors = c("plum", "tomato4"), plotit = T) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class \code{infomap_monolayer}.} 11 | 12 | \item{colors}{The fill colors of the histograms.} 13 | 14 | \item{plotit}{Also show the plots?} 15 | } 16 | \value{ 17 | A list with objecst of class \code{ggplot}: 18 | \itemize{ 19 | \item L_plot: Histogram for the map equation 20 | \item m_plot: Histogram for the number of modules 21 | } 22 | } 23 | \description{ 24 | Plot histograms for randomizations 25 | } 26 | \details{ 27 | Use ggplot to plot two histograms for the values of the map equation 28 | L and the number of modules. Dashed line is the observed value. Because 29 | returned objects are ggplot objects, they can be modified. 30 | } 31 | \examples{ 32 | \dontrun{ 33 | network_object <- create_monolayer_network(bipartite::memmott1999, 34 | bipartite = TRUE, directed = FALSE, group_names = c('Animals','Plants')) 35 | infomap_object <- run_infomap_monolayer(network_object, 36 | infomap_executable='Infomap', 37 | flow_model = 'undirected', 38 | silent=TRUE, trials=20, two_level=TRUE, seed=123, 39 | signif = TRUE, shuff_method = 'r00', nsim = 50) 40 | 41 | #get plots and plot them 42 | x <- plot_signif(infomap_object, plotit = TRUE) 43 | 44 | # Can modify the plots with ggplot2 45 | x$L_plot+ 46 | theme_bw()+ 47 | theme(legend.position='none', 48 | axis.text = element_text(size=20), 49 | axis.title = element_text(size=20)) 50 | 51 | } 52 | } 53 | \seealso{ 54 | \code{ggplot2, infomap_monolayer} 55 | } 56 | -------------------------------------------------------------------------------- /man/run_infomap_monolayer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_infomap_monolayer.R 3 | \name{run_infomap_monolayer} 4 | \alias{run_infomap_monolayer} 5 | \title{Run Infomap for monolayer networks with an option to compare to randomized 6 | networks} 7 | \usage{ 8 | run_infomap_monolayer( 9 | x, 10 | infomap_executable = "Infomap", 11 | flow_model = NULL, 12 | silent = F, 13 | trials = 100, 14 | two_level = T, 15 | seed = 123, 16 | signif = F, 17 | shuff_method = NULL, 18 | nsim = 1000, 19 | verbose = T, 20 | ... 21 | ) 22 | } 23 | \arguments{ 24 | \item{x}{An object of class \code{monolayer} (see package \code{emln} for definition).} 25 | 26 | \item{infomap_executable}{Name of Infomap standalone file.} 27 | 28 | \item{flow_model}{See details 29 | \href{https://www.mapequation.org/infomap/#ParamsAlgorithm}{here}.} 30 | 31 | \item{silent}{Run in silent mode (argumnt --silent in Infomap).} 32 | 33 | \item{trials}{Number of trials to run (argumnt -N in Infomap).} 34 | 35 | \item{two_level}{Do not use hierarchical partitioning (argumnt -2 in 36 | Infomap). See details.} 37 | 38 | \item{seed}{Seed value for random number generation (argumnt --seed in 39 | Infomap).} 40 | 41 | \item{signif}{Should a comparison for non-random versions of the network be 42 | performed?} 43 | 44 | \item{shuff_method}{Method to shuffle the network. See details.} 45 | 46 | \item{nsim}{How many shuffled networks to create?} 47 | 48 | \item{verbose}{Show progress notes} 49 | 50 | \item{...}{additional Infomap arguments as detailed 51 | \href{https://www.mapequation.org/infomap/#Parameters}{here}.} 52 | } 53 | \value{ 54 | An object of class \code{infomap_monolayer}. 55 | } 56 | \description{ 57 | Run Infomap for monolayer networks. Returns the value of the map equation (L) 58 | and a tibble with modules that includes additional node metadata (if exists). 59 | Can also compare L_obs to that obtained from shuffled versions of the 60 | network. 61 | } 62 | \details{ 63 | All of Infomap's arguments are detailed in 64 | \href{https://www.mapequation.org/infomap/#Parameters}{https://www.mapequation.org/infomap/#Parameters}. 65 | 66 | 67 | Note on hierarchical partitioning: In Infomaps tree output, the \code{path} 68 | column is a tree-like format, like that: 1:3:4:2. The first integer is the top module. The last integer after 69 | the colon indicates the ID of the leaf in the module, and not the ID of the 70 | node. In this example, the node is the 2nd leaf in module 4, which is nested 71 | in module 3, which is nested in top module 1. \code{run_infomap_monolayer} 72 | automatically parses this output to levels. In this example, there are 3 73 | module levels and the last is the leaf level. This will create columns: 74 | \code{module_level1, module_level2, module_level3, module_level4}. The 75 | column \code{levels} will show 3 because it ignores the leaf level. In case 76 | a node has fewer levels because its node is not partitioned, then the 77 | missing levels will show an NA value. A second 78 | node in the same network with a path 2:1:5 will be the 5th leaf in module 1 79 | of module 2. The values for this node will be: \code{module_level1=2, 80 | module_level2=1, module_level3=5, module_level4=NA}. 81 | 82 | If significance is \code{TRUE} then the network will be shuffled according 83 | to \code{shuff_method}. \code{shuff_method} can be either a list of already 84 | shuffled networks, produced for example with \code{shuffle_infomap}, or a 85 | shuffling method from \code{vegan::commsim}. Currently only supports 86 | shuffling for bipartite networks from the vegan package as defined in 87 | \code{vegan::commsim}. If special arguments such as burnin or thinin are 88 | needed for shuffling (e.g., for sequential algorithms), then first run 89 | \code{shuffle_infomap} separtely and provide the result as a list to 90 | \code{shuff_method}. This is because the ... argument passes additional 91 | arguments to Infomap, and not to \code{shuffle_infomap}. Significance is 92 | estimate as a 1-tailed test: 93 | 94 | P_value = sum(L_siml+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia1983_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia1983_matrix.R 3 | \docType{data} 4 | \name{siberia1983_matrix} 5 | \alias{siberia1983_matrix} 6 | \title{Siberia 1983 host-parasite temporal matrix} 7 | \format{ 8 | A numeric matrix with rows representing host species and columns representing parasite species. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia1983_matrix) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia1984_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia1984_matrix.R 3 | \docType{data} 4 | \name{siberia1984_matrix} 5 | \alias{siberia1984_matrix} 6 | \title{Siberia 1984 host-parasite temporal matrix} 7 | \format{ 8 | A numeric matrix with rows representing host species and columns representing parasite species. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia1984_matrix) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia1985_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia1985_matrix.R 3 | \docType{data} 4 | \name{siberia1985_matrix} 5 | \alias{siberia1985_matrix} 6 | \title{Siberia 1985 host-parasite temporal matrix} 7 | \format{ 8 | A numeric matrix with rows representing host species and columns representing parasite species. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia1985_matrix) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia1986_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia1986_matrix.R 3 | \docType{data} 4 | \name{siberia1986_matrix} 5 | \alias{siberia1986_matrix} 6 | \title{Siberia 1986 host-parasite temporal matrix} 7 | \format{ 8 | A numeric matrix with rows representing host species and columns representing parasite species. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia1986_matrix) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia1987_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia1987_matrix.R 3 | \docType{data} 4 | \name{siberia1987_matrix} 5 | \alias{siberia1987_matrix} 6 | \title{Siberia 1987 host-parasite temporal matrix} 7 | \format{ 8 | A numeric matrix with rows representing host species and columns representing parasite species. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia1987_matrix) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/siberia_interlayer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia_interlayer.R 3 | \docType{data} 4 | \name{siberia_interlayer} 5 | \alias{siberia_interlayer} 6 | \title{Siberia interlayer edges} 7 | \format{ 8 | Edge list format (layer_from node_from layer_to node_to weight). 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia_interlayer) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia_nodes} for information about the nodes. 34 | 35 | See \code{siberia1982_matrix} Siberia 1982 host-parasite temporal matrix. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | interlayer_links = siberia_interlayer, 58 | bipartite = T, 59 | directed = F, physical_node_attributes = siberia_nodes ) 60 | } 61 | \references{ 62 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 63 | 64 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 65 | 66 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 67 | } 68 | \keyword{datasets} 69 | -------------------------------------------------------------------------------- /man/siberia_nodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/siberia_nodes.R 3 | \docType{data} 4 | \name{siberia_nodes} 5 | \alias{siberia_nodes} 6 | \title{Host-parasite temporal multilayer network: nodes} 7 | \format{ 8 | An object of class \code{matrix} (inherits from \code{array}) with 3 rows and 4 columns. 9 | } 10 | \source{ 11 | Simulated data for illustration purposes. 12 | } 13 | \usage{ 14 | data(siberia_nodes) 15 | } 16 | \description{ 17 | Host-parasite temporal multilayer network. 18 | This data set contains the matrices of a temporal multilayer 19 | network representing the infection of 22 small mammalian host species by 20 | 56 ectoparasite species during 6 consecutive summers in Siberia 21 | (1982–1987). 22 | } 23 | \details{ 24 | The data set is in an matrix format.Each layer is a host-parasite bipartite network. 25 | Intralayer edges between a parasite species and a host species are the 26 | number of parasite individuals divided by the number of host individuals. 27 | Interlayer coupling edges connect each physical node to itself in the next 28 | layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as 29 | the number of individuals in layer l+1 divided by the number of individuals 30 | in layer l. They therefore represent population dynamics. Interlayer edges 31 | only go one way (_l-->l+1_) because time flow one way. 32 | 33 | See \code{siberia1982_matrix} Siberia 1982 host-parasite temporal matrix. 34 | 35 | See \code{siberia_interlayer} for information about the interlayer edges. 36 | } 37 | \examples{ 38 | data(siberia1982_matrix) 39 | data(siberia1983_matrix) 40 | data(siberia1984_matrix) 41 | data(siberia1985_matrix) 42 | data(siberia1986_matrix) 43 | data(siberia1987_matrix) 44 | data(siberia_nodes) 45 | data(siberia_interlayer) 46 | 47 | # Create a multilayer object 48 | layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) 49 | 50 | multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, 51 | siberia1983_matrix, 52 | siberia1984_matrix, 53 | siberia1985_matrix, 54 | siberia1986_matrix, 55 | siberia1987_matrix), 56 | layer_attributes = layer_attrib, 57 | bipartite = T, 58 | directed = F, physical_node_attributes = siberia_nodes ) 59 | } 60 | \references{ 61 | Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128. 62 | 63 | Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996. 64 | 65 | Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101. 66 | } 67 | \keyword{datasets} 68 | -------------------------------------------------------------------------------- /man/tur2016.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tur2016-data.R 3 | \docType{data} 4 | \name{tur2016} 5 | \alias{tur2016} 6 | \title{Pollen movement data} 7 | \format{ 8 | An object of class \code{data.frame} with 3897 rows and 10 columns. 9 | } 10 | \source{ 11 | \href{https://figshare.com/articles/dataset/Data_package_from_Evaluating_the_effects_of_pollinator_mediated_interactions_using_pollen_transfer_networks_evidence_of_widespread_facilitation_in_south_Andean_plant_communities_Tur_et_al_2016_/2242447}{Data 12 | on Figshare} 13 | } 14 | \usage{ 15 | data(tur2016) 16 | } 17 | \description{ 18 | Data on conspecific and heterospecific movement of pollen grains. 19 | } 20 | \examples{ 21 | data(tur2016) 22 | } 23 | \references{ 24 | Tur C, Sáez A, Traveset A, Aizen MA. Evaluating the effects of 25 | pollinator-mediated interactions using pollen transfer networks: evidence 26 | of widespread facilitation in south Andean plant communities. Ecol Lett. 27 | 2016;19: 576–586. 28 | 29 | \href{https://onlinelibrary.wiley.com/doi/abs/10.1111/ele.12594}{Link to paper} 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /multilayer_example.csv: -------------------------------------------------------------------------------- 1 | layer_from,node_from,layer_to,node_to,weight 2 | 1,1,1,2,1 3 | 1,1,1,3,1 4 | 1,1,1,4,1 5 | 1,3,1,4,1 6 | 1,2,1,4,1 7 | 1,2,1,3,1 8 | 1,5,1,6,1 9 | 1,5,1,7,1 10 | 1,5,1,8,1 11 | 1,7,1,8,1 12 | 1,6,1,8,1 13 | 1,6,1,7,1 14 | 2,1,2,2,1 15 | 2,1,2,3,1 16 | 2,1,2,4,1 17 | 2,3,2,4,1 18 | 2,2,2,4,1 19 | 2,3,2,7,1 20 | 2,5,2,6,1 21 | 2,5,2,7,1 22 | 2,5,2,8,1 23 | 2,7,2,8,1 24 | 2,6,2,8,1 25 | 2,2,2,6,1 26 | 3,1,3,5,1 27 | 3,1,3,7,1 28 | 3,1,3,3,1 29 | 3,5,3,7,1 30 | 3,5,3,3,1 31 | 3,3,3,7,1 32 | 3,4,3,2,1 33 | 3,4,3,6,1 34 | 3,4,3,8,1 35 | 3,8,3,2,1 36 | 3,8,3,6,1 37 | 3,6,3,2,1 38 | 4,1,4,5,1 39 | 4,1,4,2,1 40 | 4,1,4,3,1 41 | 4,5,4,7,1 42 | 4,5,4,3,1 43 | 4,3,4,7,1 44 | 4,4,4,2,1 45 | 4,4,4,6,1 46 | 4,4,4,8,1 47 | 4,7,4,8,1 48 | 4,8,4,6,1 49 | 4,6,4,2,1 -------------------------------------------------------------------------------- /readme badges.R: -------------------------------------------------------------------------------- 1 | library(badger) 2 | badger::badge_doi(doi = "10.1111/2041-210X.13569", color = 'orange') 3 | badger::badge_lifecycle(stage = 'stable', color = 'green') 4 | badger::badge_repostatus(status = 'Active') 5 | badger::badge_custom(x = 'devtools installation', y = 'v2.0', color = 'yellow') 6 | -------------------------------------------------------------------------------- /website_source/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/.DS_Store -------------------------------------------------------------------------------- /website_source/Infomap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/Infomap -------------------------------------------------------------------------------- /website_source/_site.yml: -------------------------------------------------------------------------------- 1 | name: "infomapecology package" 2 | output_dir: "docs" 3 | navbar: 4 | title: "The infomapecology package website" 5 | left: 6 | - text: "Home" 7 | href: index.html 8 | - text: "Installation" 9 | href: installation.html 10 | - text: "Monolayer" 11 | #href: monolayer/index.html 12 | menu: 13 | - text: "Bipartite monolayer network example" 14 | href: bipartite.html 15 | - text: "Monolayer directed network with hierarchical structure" 16 | href: monolayer_heirarchical.html 17 | - text: "Monolayer directed network with node attributes" 18 | href: monolayer_node_attributes.html 19 | - text: "Multilayer" 20 | menu: 21 | - text: "Temporal multilayer network with global relax rates" 22 | href: multilayer_relax_emln.html 23 | - text: "Temporal multilayer network with interlayer edges" 24 | href: multilayer_interlayer_emln.html 25 | - text: "Flow models" 26 | href: flows.html 27 | - text: "Hypothesis testing" 28 | href: hypothesis_test.html 29 | - text: "About" 30 | href: about.html 31 | 32 | logo: 33 | image: ecompab.png 34 | href: https://ecological-complexity-lab.github.io/infomap_ecology_package/ 35 | output: 36 | html_document 37 | -------------------------------------------------------------------------------- /website_source/about.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | output: 4 | html_document: 5 | fig_height: 6 6 | fig_width: 9 7 | theme: flatly 8 | code_folding: show 9 | toc: true 10 | toc_float: 11 | collapsed: false 12 | number_sections: true 13 | --- 14 | 15 |
    16 |
    17 | 18 | The package and this website were developed in the [Ecological Complexity Lab](http://www.bgu.ac.il/ecomplab), in Israel. 19 | 20 | The R package code is available on GitHub here: [https://github.com/Ecological-Complexity-Lab/infomap_ecology_package](https://github.com/Ecological-Complexity-Lab/infomap_ecology_package) 21 | 22 |
    23 |
    24 | 25 | # Grants 26 | 27 | - Israel Science Foundation (grant number 1281/20): "Ecological multilayer networks: advancing theory and methodology for understanding the complexity of ecological systems", awarded to Dr. Shai Pilosof. 28 | - Swedish Research Council (grant no. 2016-00796) , awarded to Martin Rosvall. 29 | - Swedish Research Council (grant no. 2016-04919), awarded to Anna Eklöf. 30 | 31 |
    32 |
    33 | 34 | # Feedback 35 | We welcome any feedback on the paper and this website! The best way to provide feedback is to open an issue on the GitHub repository of the package: [https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues](https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues). 36 | 37 |
    38 | 39 | ___ 40 | 41 | ```{r out.height="80px", out.extra='style="float:left, padding:10px"', echo=FALSE} 42 | knitr::include_graphics("logos_6.png") 43 | ``` -------------------------------------------------------------------------------- /website_source/bipartite.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Bipartite monolayer network example" 3 | output: 4 | html_document: 5 | fig_height: 6 6 | fig_width: 9 7 | theme: flatly 8 | code_folding: show 9 | toc: true 10 | toc_float: 11 | collapsed: false 12 | number_sections: true 13 | --- 14 | 15 | ```{r klippy, echo=FALSE, include=TRUE} 16 | # Use this to add a copy-code buttong 17 | klippy::klippy(position = c('top', 'right'), color = 'darkred') 18 | ``` 19 | 20 | ```{r setup, include=FALSE} 21 | knitr::opts_chunk$set(echo = TRUE) 22 | ``` 23 | 24 |
    25 |
    26 | 27 | ### Data set 28 | A weighted bipartite network describing a plant-flower visitor interaction web (25 plant species and 79 flower visitor species) in the vicinity of Bristol, U.K. To distinguish between the two node sets we number the pollinator species from 1-79 and the plants from 80-104. Data can be obtained using `data(memmott1999)` in package `bipartite`. 29 | 30 |
    31 |
    32 | 33 | ### Input 34 | A [link list](https://www.mapequation.org/infomap/#InputLinkList) with columns `from`, `to` and `weight`. Because this is a bipartite network the `from` column can only contain nodes 1-79 and the `to` column nodes 84-104. 35 | 36 |
    37 |
    38 | 39 | ### R Code 40 | ```{r Bipartite_1} 41 | # Import data 42 | library(infomapecology) 43 | library(bipartite) 44 | data(memmott1999) 45 | 46 | network_object <- create_monolayer_network(memmott1999, bipartite = T, directed = F, group_names = c('A','P')) 47 | infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 48 | flow_model = 'undirected', 49 | silent=T, trials=20, two_level=T, seed=123) 50 | 51 | # Plot the matrix (plotting function in beta) 52 | plot_modular_matrix(infomap_object) 53 | ``` 54 | 55 |
    56 | 57 | ### Infomap 58 | Under the hood, the function `run_infomap_monolayer` runs: 59 | 60 | ```C++ 61 | ./Infomap infomap.txt . --tree -i link-list --seed 123 -N 20 -f undirected -2 62 | ``` 63 | 64 | With this command, Infomap detects modules that contain both plants and pollinators. 65 | * `-f undirected` indicates flow on an undirected network. 66 | * `-2` indicates a two-level solution, with no hierarchical modules. 67 | 68 |
    69 |
    70 | 71 | ### Output 72 | A [tree file](https://www.mapequation.org/infomap/#OutputTree) is produced by Infomap, but is parsed by `run_infomap_monolayer` from infomapecology (in R: `?run_infomap_monolayer`). 73 | -------------------------------------------------------------------------------- /website_source/ecomplab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/ecomplab.png -------------------------------------------------------------------------------- /website_source/flows.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Flow models" 3 | output: 4 | html_document: 5 | fig_height: 6 6 | fig_width: 9 7 | theme: flatly 8 | code_folding: show 9 | toc: true 10 | toc_float: 11 | collapsed: false 12 | number_sections: true 13 | --- 14 | 15 | ```{r klippy, echo=FALSE, include=TRUE} 16 | # Use this to add a copy-code buttong 17 | klippy::klippy(position = c('top', 'right'), color = 'darkred') 18 | ``` 19 | 20 | ```{r setup, include=FALSE} 21 | knitr::opts_chunk$set(echo = TRUE) 22 | ``` 23 | 24 |
    25 |
    26 | 27 | ### Data set 28 | Weighted directed networks of pollen transfer from [Tur C, Sáez A, Traveset A, Aizen MA. Evaluating the effects of pollinator-mediated interactions using pollen transfer networks: evidence of widespread facilitation in south Andean plant communities. Ecol Lett. 2016;19: 576–586](https://onlinelibrary.wiley.com/doi/abs/10.1111/ele.12594). 29 | 30 |
    31 | 32 | ### Input 33 | A [link-list](https://www.mapequation.org/infomap/#InputLinkList). 34 | 35 |
    36 | 37 | ### R Code 38 | ```{r flow_1} 39 | # Import data 40 | data(tur2016) 41 | tur2016_altitude2000 <- tur2016 %>% 42 | filter(altitude==2000) %>% 43 | select("donor", "receptor", "total") %>% 44 | group_by(donor, receptor) %>% 45 | summarise(n=mean(total)) %>% 46 | rename(from = donor, to = receptor, weight = n) %>% 47 | ungroup() %>% 48 | slice(c(-10,-13,-28)) %>% # Remove singletons 49 | filter(from!=to) # Remove self loops 50 | 51 | network_object <- create_monolayer_network(tur2016_altitude2000, 52 | directed = T, bipartite = F) 53 | res_dir <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 54 | flow_model = 'directed', 55 | silent=T,trials=100, two_level=T, seed=200952) 56 | res_rawdir <- run_infomap_monolayer(network_object, infomap_executable='Infomap', 57 | flow_model = 'rawdir', 58 | silent=T,trials=100, two_level=T, seed=200952) 59 | 60 | res_dir_modules <- res_dir$modules %>% drop_na() 61 | res_rawdir_modules <- res_rawdir$modules %>% drop_na() 62 | 63 | 64 | # Compare the results using normalised mutual information 65 | N <- res_dir_modules %>% # Create confusion matrix 66 | select(-module_level2) %>% 67 | inner_join(res_rawdir_modules %>% select(node_id,module_level1), by='node_id') %>% 68 | arrange(module_level1.x,module_level1.y) %>% 69 | group_by(module_level1.y) %>% select(module_level1.x) %>% table() 70 | 71 | # These two different modes of flow can result in different partitions. 72 | NMI(N) 73 | 74 | ``` 75 | 76 |
    77 | 78 | ### Infomap 79 | Under the hood, the function `run_infomap_monolayer` runs: 80 | 81 | For **real measured** flows: 82 | ```C++ 83 | ./Infomap infomap.txt . -i link-list --tree --seed 200952 -N 100 -f rawdir --two-level 84 | ``` 85 | 86 | For **constraints** on flows: 87 | ```C++ 88 | ./Infomap infomap.txt . -i link-list --tree --seed 200952 -N 100 -f directed --two-level 89 | ``` 90 | 91 | Explanation of key arguments: 92 | * `-f directed` indicates flow on a directed network. The visitation rates of nodes is obtained with a PageRank algorithm based on the direction and weight of edges. 93 | * `-f rawdir` or `-f directed`: In a `rawdir` flow model the visitation rates of nodes is determined without a PageRank algorithm but rather by the given direction and weight of edges. In a `directed` flow model edge weights are assumed to be constraints on flow, and a PageRank algorithm is run first to determine flow. 94 | 95 |
    96 | 97 | ### Output 98 | A [tree file](https://www.mapequation.org/infomap/#OutputTree) is produced by Infomap, but is parsed by `run_infomap_monolayer` from infomapecology (in R: `?run_infomap_monolayer`). 99 | -------------------------------------------------------------------------------- /website_source/installation.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Install Infomap and infomapecology" 3 | output: 4 | html_document: 5 | fig_height: 6 6 | fig_width: 9 7 | theme: flatly 8 | code_folding: show 9 | toc: true 10 | toc_float: 11 | collapsed: false 12 | number_sections: true 13 | --- 14 | 15 | ```{r klippy, echo=FALSE, include=TRUE} 16 | # Use this to add a copy-code buttong 17 | klippy::klippy(position = c('top', 'right'), color = 'darkred') 18 | ``` 19 | 20 |
    21 |
    22 | 23 | # 1. Install the R package 24 | The package was built under R 4.1 and depends on other packages. 25 | 26 | ```R 27 | # Install (if not installed) and load necessary packages 28 | package.list=c("attempt", "cowplot", "igraph", "ggalluvial","magrittr","vegan", "dplyr","readr","ggplot2","stringr","tibble","tidyr","rlang","bipartite","tidyverse", "Matrix","DT","hablar","devtools") 29 | loaded <- package.list %in% .packages() 30 | package.list <- package.list[!loaded] 31 | installed <- package.list %in% .packages(TRUE) 32 | if (!all(installed)) install.packages(package.list[!installed], repos="http://cran.rstudio.com/") 33 | 34 | devtools::install_github('Ecological-Complexity-Lab/emln', force=T) 35 | library(emln) 36 | 37 | # Install infomapecology 38 | devtools::install_github('Ecological-Complexity-Lab/infomap_ecology_package', force=T) 39 | library(infomapecology) 40 | 41 | # Check the version. 42 | packageDescription('infomapecology') 43 | ``` 44 | 45 |
    46 |
    47 | 48 | # 2. Install Infomap 49 | We use Infomap version 2.x as a stand-alone file. We are working on integrating Infomap directly intro R. 50 | 51 |
    52 | 53 | ## MacOS (Linux should be similar) 54 | ### 1. In the terminal run: 55 | * `xcode-select --install` 56 | * For OpenMP support 57 | * Install homebrew as specified in [https://brew.sh](https://brew.sh). This will take a while. 58 | * install packages: `brew install libomp`. 59 | 60 | ### 2. Then either: 61 | Install Infomap via the `install_infomap` function in the package as below. Avoid folder names with spaces or non-english lettes. 62 | 63 | ```R 64 | setwd('where your Infomap file and R script will live') 65 | install_infomap() 66 | 67 | # Check Infomap is running 68 | setwd('where your Infomap file and R script now live') 69 | check_infomap() # Make sure file can be run correctly. Should return TRUE 70 | ``` 71 | 72 | or download a binary from [here](https://github.com/mapequation/infomap/releases/latest) and put the file in the working folder. 73 | 74 |
    75 | 76 | ## Windows 77 | 78 | Install Infomap via the `install_infomap` function in the package as below. Avoid folder names with spaces or non-english lettes. 79 | 80 | ```R 81 | setwd('where your Infomap file and R script will live') 82 | install_infomap() 83 | 84 | # Check Infomap is running 85 | setwd('where your Infomap file and R script now live') 86 | check_infomap() # Make sure file can be run correctly. Should return TRUE 87 | ``` 88 | 89 | or download a binary from [here](https://github.com/mapequation/infomap/releases/latest) and put the file in the working folder. 90 | 91 | 92 | **Important notes:** 93 | 94 | 1. The best practice is to compile Infomap under the file name "Infomap" and place it in the 95 | same working folder in which the R code is run. 96 | 97 | 2. Other ways to install: [https://www.mapequation.org/infomap/#Install](https://www.mapequation.org/infomap/#Install) 98 | -------------------------------------------------------------------------------- /website_source/logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/logos.png -------------------------------------------------------------------------------- /website_source/logos_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/logos_6.png -------------------------------------------------------------------------------- /website_source/logos_new31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ecological-Complexity-Lab/infomap_ecology_package/fe6ffe5d2fc2efed106ae52eb7ef85b757fccfdc/website_source/logos_new31.jpg -------------------------------------------------------------------------------- /website_source/make_site.R: -------------------------------------------------------------------------------- 1 | #devtools::install_github('Ecological-Complexity-Lab/infomap_ecology_package', force=T) 2 | library(infomapecology) 3 | remotes::install_github("rlesur/klippy") 4 | 5 | #setwd("/Users/shai/GitHub/ecomplab/emln_package") 6 | setwd("/Users/shirlyf/Documents/GitHub/infomap_ecology_package") 7 | 8 | # Make the website 9 | rmarkdown::render_site(input = 'website_source') 10 | 11 | #rmarkdown::render("website_source/monolayer/bipartite.Rmd", output_format = "html_document", output_dir = "website_source/docs/monolayer/") 12 | #rmarkdown::render("website_source/monolayer/monolayer_heirarchical.Rmd", output_format = "html_document", output_dir = "website_source/docs/monolayer/") 13 | 14 | 15 | 16 | # Remove unnecesary files 17 | unlink('docs/', recursive = TRUE, force = FALSE) 18 | file.copy('website_source/docs/', '.', recursive = T) 19 | unlink('website_source/analysis_example_files/', recursive = TRUE, force = FALSE) 20 | unlink('website_source/docs/', recursive = TRUE, force = FALSE) 21 | -------------------------------------------------------------------------------- /website_source/otago_node_attributes.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 2 1 3 | 3 1 4 | 4 2 5 | 5 3 6 | 6 4 7 | 7 5 8 | 8 5 9 | 9 6 10 | 10 6 11 | 11 7 12 | 12 7 13 | 13 7 14 | 14 7 15 | 15 7 16 | 16 7 17 | 17 7 18 | 18 7 19 | 19 7 20 | 20 7 21 | 21 7 22 | 22 7 23 | 23 7 24 | 24 7 25 | 25 7 26 | 26 7 27 | 27 7 28 | 28 7 29 | 29 7 30 | 30 8 31 | 31 8 32 | 32 9 33 | 33 10 34 | 34 10 35 | 35 10 36 | 36 10 37 | 37 10 38 | 38 11 39 | 39 12 40 | 40 12 41 | 41 13 42 | 42 13 43 | 43 13 44 | 44 14 45 | 45 14 46 | 46 14 47 | 47 14 48 | 48 14 49 | 49 15 50 | 50 15 51 | 51 15 52 | 52 15 53 | 53 15 54 | 54 15 55 | 55 16 56 | 56 5 57 | 57 6 58 | 58 6 59 | 59 6 60 | 60 6 61 | 61 7 62 | 62 7 63 | 63 7 64 | 64 7 65 | 65 7 66 | 66 7 67 | 67 7 68 | 68 7 69 | 69 7 70 | 70 7 71 | 71 7 72 | 72 7 73 | 73 7 74 | 74 7 75 | 75 7 76 | 76 7 77 | 77 7 78 | 78 7 79 | 79 7 80 | 80 7 81 | 81 7 82 | 82 8 83 | 83 17 84 | 84 10 85 | 85 10 86 | 86 10 87 | 87 10 88 | 88 10 89 | 89 11 90 | 90 11 91 | 91 13 92 | 92 14 93 | 93 14 94 | 94 14 95 | 95 14 96 | 96 14 97 | 97 18 98 | 98 15 99 | 99 14 100 | 100 19 101 | 101 19 102 | 102 19 103 | 103 19 104 | 104 19 105 | 105 20 106 | 106 20 107 | 107 21 108 | 108 21 109 | 109 21 110 | 110 21 111 | 111 21 112 | 112 21 113 | 113 21 114 | 114 21 115 | 115 21 116 | 116 21 117 | 117 21 118 | 118 21 119 | 119 21 120 | 120 21 121 | 121 21 122 | 122 21 123 | 123 21 124 | 124 22 125 | 125 22 126 | 126 22 127 | 127 22 128 | 128 22 129 | 129 22 130 | 130 22 131 | 131 22 132 | 132 22 133 | 133 22 134 | 134 23 135 | 135 23 136 | 136 24 137 | 137 24 138 | 138 25 139 | 139 22 140 | 140 13 141 | --------------------------------------------------------------------------------