Skip to content

Commit

Permalink
make ddply call explicit in ggord
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jul 16, 2024
1 parent 0746bab commit 22f7e43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: ggord
Type: Package
Title: Ordination Plots with ggplot2
Version: 1.1.7
Date: 2022-03-24
Date: 2024-07-16
Author: Marcus W. Beck [aut, cre]
Maintainer: Marcus W. Beck <[email protected]>
Description: Create ordination biplots with ggplot2. Multiple methods are
Expand Down Expand Up @@ -33,5 +33,5 @@ Suggests:
Authors@R: person(given = "Marcus W.", family = "Beck",
role = c("aut","cre"),
email = "[email protected]")
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
VignetteBuilder: knitr
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ S3method(ggord,princomp)
S3method(ggord,rda)
export(ggord)
import(ggplot2)
import(plyr)
8 changes: 4 additions & 4 deletions R/ggord.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#'
#' @export
#'
#' @import ggplot2 plyr
#' @import ggplot2
#'
#' @return A \code{\link[ggplot2]{ggplot}} object that can be further modified
#'
Expand Down Expand Up @@ -368,7 +368,7 @@ ggord.default <- function(obs, vecs, axes = c('1', '2'), grp_in = NULL, cols = N
theta <- c(seq(-pi, pi, length = 50), seq(pi, -pi, length = 50))
circle <- cbind(cos(theta), sin(theta))

ell <- ddply(obs, 'Groups', function(x) {
ell <- plyr::ddply(obs, 'Groups', function(x) {
if(nrow(x) <= 2) {
return(NULL)
}
Expand All @@ -384,7 +384,7 @@ ggord.default <- function(obs, vecs, axes = c('1', '2'), grp_in = NULL, cols = N
names(ell)[2:3] <- c('one', 'two')

# get convex hull for ell object, this is a hack to make it work with geom_polygon
ell <- ddply(ell, .(Groups), function(x) x[chull(x$one, x$two), ])
ell <- plyr::ddply(ell, 'Groups', function(x) x[chull(x$one, x$two), ])

if(poly){

Expand All @@ -408,7 +408,7 @@ ggord.default <- function(obs, vecs, axes = c('1', '2'), grp_in = NULL, cols = N
if(!is.null(obs$Groups)){

# get convex hull
chulls <- ddply(obs, .(Groups), function(x) x[chull(x$one, x$two), ])
chulls <- plyr::ddply(obs, 'Groups', function(x) x[chull(x$one, x$two), ])

if(poly){

Expand Down

0 comments on commit 22f7e43

Please sign in to comment.