Skip to content

Commit

Permalink
import "!!" from rlang and n from dplyr.
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Sep 2, 2017
1 parent 1cbc2aa commit b2d0624
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -45,6 +45,7 @@ Imports:
pegas,
reshape2,
dplyr (>= 0.4),
rlang,
boot,
shiny,
magrittr
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Expand Up @@ -129,6 +129,7 @@ importFrom(boot,norm.ci)
importFrom(dplyr,"%>%")
importFrom(dplyr,arrange_)
importFrom(dplyr,group_by_)
importFrom(dplyr,n)
importFrom(dplyr,progress_estimated)
importFrom(dplyr,ungroup)
importFrom(grDevices,as.raster)
Expand Down Expand Up @@ -166,6 +167,7 @@ importFrom(pegas,loci2genind)
importFrom(phangorn,midpoint)
importFrom(phangorn,upgma)
importFrom(reshape2,melt)
importFrom(rlang,"!!")
importFrom(stats,as.dist)
importFrom(stats,as.formula)
importFrom(stats,dbinom)
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Expand Up @@ -27,6 +27,12 @@ MISC
* The internal plotting function for mlg.table now uses tidy evaluation for
dplyr versions > 0.5.0.

NEW IMPORTS
-----------

* Due to the migration to dplyr version 0.7.0, poppr now imports the "!!"
operator from the rlang package.

poppr 2.4.1
===========

Expand Down
5 changes: 3 additions & 2 deletions R/internal.r
Expand Up @@ -1727,7 +1727,8 @@ test_zeroes <- function(x){
#'
#' @importFrom dplyr %>%
#' @importFrom dplyr arrange_ group_by_ ungroup
#' @importFrom dplyr `!!`
#' @importFrom dplyr n
#' @importFrom rlang "!!"
mlg_barplot <- function(mlgt, color = FALSE, background = FALSE){
names(dimnames(mlgt)) <- c("Population", "MLG")
mlgt.df <- reshape2::melt(mlgt, value.name = "count")
Expand Down Expand Up @@ -1789,7 +1790,7 @@ mlg_barplot <- function(mlgt, color = FALSE, background = FALSE){
dplyr::ungroup() %>%
unique() %>%
dplyr::filter(!!quote(count > 0)) %>%
dplyr::mutate(order = seq(dplyr::n())) %>%
dplyr::mutate(order = seq(n())) %>%
dplyr::mutate(order = factor(!!quote(order), unique(!!quote(order))))
}

Expand Down

0 comments on commit b2d0624

Please sign in to comment.