Skip to content

Commit

Permalink
🐛 Correct bug beta div if two sp same place
Browse files Browse the repository at this point in the history
  • Loading branch information
CmlMagneville committed Oct 16, 2023
1 parent fe522ed commit 09a4e96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mFD (development version)
* Fix bug:
* Correct the sp.plot() fct when plotting one asb (pb with vertices aes)
* Correct the sp.plot() fct when several sp same place but only one as vert

# mFD 1.0.5
* Fix bug:
Expand Down
9 changes: 9 additions & 0 deletions R/plot_multidim_layers.R
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ sp.plot <- function(ggplot_bg,
ggplot2::scale_size(limits = limits_relatw, range = range_size_relatw)


# Reorder the column with vertices information:
# To first plot sp and then vertices (if 2 species same place but one vert
# and the other not vert):
order_vert_levels <- c("no", "vert")
asb_sp_xywv$vert <- factor(as.character(asb_sp_xywv$vert),
levels = order_vert_levels)
asb_sp_xywv <- asb_sp_xywv[order(asb_sp_xywv$vert), ]


# plot species as points with chosen shape, size and colors:
ggplot_sp <- ggplot_sp +
ggplot2::geom_point(data = asb_sp_xywv,
Expand Down

0 comments on commit 09a4e96

Please sign in to comment.