Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

update Mangal integration example #182

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions docs/src/examples/mangal.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,12 @@ foodwebs = mangal_networks[mangal_networks[!, :pred] .+ mangal_networks[!, :herb
first(foodwebs, 5)
```

To analyse their properties, we first need to read all of these food webs using the `Mangal.jl` package, and then convert them to UnipartiteNetworks, when possible, using the `EcologicalNetworks.jl` package. We end up with 241 unipartite food webs.
To analyse their properties, we first need to read all of these food webs using the `Mangal.jl` package, and then convert them to UnipartiteNetworks using the `EcologicalNetworks.jl` package.

```@example mangal
mangal_foodwebs = network.(foodwebs.id)

unipartite_foodwebs = []

for i in eachindex(mangal_foodwebs)
try
unipartite_foodweb = convert(UnipartiteNetwork, mangal_foodwebs[i])
push!(unipartite_foodwebs, unipartite_foodweb)
catch
end
end
unipartite_foodwebs = convert.(UnipartiteNetwork, mangal_foodwebs)

unipartite_foodwebs[1:5]
```
Expand Down