Skip to content

Commit

Permalink
minor bug fix: don't modify the input label dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
cecileane committed Sep 19, 2022
1 parent 7714131 commit 30cc688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/phylonetworksPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function check_nodedataframe(net::HybridNetwork, nodelabel::DataFrame)
labelnodes = false
end
if labelnodes # remove rows with no node number, check if at least one row remains
filter!(row->!ismissing(row[1]), nodelabel)
nodelabel = filter(row->!ismissing(row[1]), nodelabel) # creates a copy: don't modify the user's df
labelnodes = size(nodelabel,1)>0
end
if labelnodes
Expand Down Expand Up @@ -371,7 +371,7 @@ function prepare_edgedataframe(net::HybridNetwork, edgelabel::DataFrame, style::
labeledges = false
end
if labeledges # remove rows with no edge number and check if at least one remains
filter!(row->!ismissing(row[1]), edgelabel)
edgelabel = filter(row->!ismissing(row[1]), edgelabel) # creates a copy: don't modify the user's df
labeledges = size(edgelabel,1)>0
end
if labeledges
Expand Down

0 comments on commit 30cc688

Please sign in to comment.