Skip to content

Commit 0555de5

Browse files
authored
Merge pull request #264 from grunwaldlab/znk/ggplot2-maintenance/263
use modern ggplot2 labs idiom
2 parents 3e87697 + 4f6600f commit 0555de5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+202
-182
lines changed

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 2.9.6
2-
Date: 2024-03-15 16:50:51 UTC
3-
SHA: ef69ace403850e8149c4c1728de6190d36195bd3
1+
Version: 2.9.7
2+
Date: 2025-06-18 23:41:37 UTC
3+
SHA: 43eb0047542d0bc739f6ea19bc95e008431f2119

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: poppr
22
Type: Package
33
Title: Genetic Analysis of Populations with Mixed Reproduction
4-
Version: 2.9.6
4+
Version: 2.9.7
55
Authors@R: c(person(c("Zhian", "N."), "Kamvar", role = c("cre", "aut"),
66
email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")),
77
person(c("Javier", "F."), "Tabima", role = "aut",
@@ -67,4 +67,4 @@ Suggests:
6767
Config/Needs/check: dbailleul/RClone
6868
License: GPL-2 | GPL-3
6969
VignetteBuilder: knitr
70-
RoxygenNote: 7.2.3
70+
RoxygenNote: 7.3.2.9000

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
poppr 2.9.7
2+
===========
3+
4+
MISC
5+
----
6+
7+
* compatibility fix for ggplot2 4.0.0 (reported: @teunbrand, #263,
8+
fixed: @zkamvar, #264)
9+
* CRAN maintenance: documentaiton fixes
10+
111
poppr 2.9.6
212
===========
313

R/Index_calculations.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
#'
162162
#' This function outputs a \pkg{ggplot2} graphic of histograms. These can be
163163
#' manipulated to be visualized in another manner by retrieving the plot with
164-
#' the [last_plot()] command from \pkg{ggplot2}. A useful manipulation would
164+
#' the last plot command from \pkg{ggplot2}. A useful manipulation would
165165
#' be to arrange the graphs into a single column so that the values of the
166166
#' statistic line up: `p <- last_plot(); p + facet_wrap(~population,
167167
#' ncol = 1, scales = "free_y")` The name for the groupings is

R/aaaMLGmethods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ setMethod(
353353
#' @export
354354
#' @keywords internal
355355
#' @seealso \code{\link{MLG}} \code{\linkS4class{genclone}}
356-
#' \code{\linkS4class{genlight}} \code{\link{initialize,MLG-method}}
356+
#' \code{\link[adegenet:genlight-class]{genlight}} \code{\link{initialize,MLG-method}}
357357
#' \code{\link{levels,MLG-method}} \code{\link{unique,MLG-method}}
358358
#'
359359
#' @examples

R/bruvo.r

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#'
5555
#' Calculate the average Bruvo's distance over all loci in a population.
5656
#'
57-
#' @param pop a \code{\link{genind}} or \code{\link{genclone}} object
57+
#' @param pop a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
5858
#'
5959
#' @param replen a \code{vector} of \code{integers} indicating the length of the
6060
#' nucleotide repeats for each microsatellite locus. E.g. a locus with a (CAT)
@@ -243,9 +243,9 @@ bruvo.dist <- function(pop, replen = 1, add = TRUE, loss = TRUE, by_locus = FALS
243243
#' Only diferences between query individuals and reference individuals will be reported
244244
#' All other values are NaN
245245
#'
246-
#' @param query a \code{\link{genind}} or \code{\link{genclone}} object
246+
#' @param query a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
247247
#'
248-
#' @param ref a \code{\link{genind}} or \code{\link{genclone}} object
248+
#' @param ref a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
249249
#'
250250
#' @export
251251
#' @author David Folarin
@@ -282,7 +282,7 @@ bruvo.between <- function(query, ref, replen = 1, add = TRUE, loss = TRUE, by_lo
282282
#
283283
#' Create a tree using Bruvo's Distance with non-parametric bootstrapping.
284284
#'
285-
#' @param pop a \code{\link{genind}} or \code{\link{genclone}} object
285+
#' @param pop a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
286286
#'
287287
#' @param replen a \code{vector} of \code{integers} indicating the length of the
288288
#' nucleotide repeats for each microsatellite locus.
@@ -315,15 +315,15 @@ bruvo.between <- function(query, ref, replen = 1, add = TRUE, loss = TRUE, by_lo
315315
#' \code{FALSE}. By default, it is set to \code{NULL}, which will assume an
316316
#' unrooted phylogeny unless the function name contains "upgma".
317317
#'
318-
#' @param ... any argument to be passed on to \code{\link{boot.phylo}}. eg.
318+
#' @param ... any argument to be passed on to \code{\link[ape]{boot.phylo}}. eg.
319319
#' \code{quiet = TRUE}.
320320
#'
321321
#'
322322
#' @return a tree of class phylo with nodelables
323323
#'
324-
#' @seealso \code{\link{bruvo.dist}}, \code{\link{nancycats}},
325-
#' \code{\link{upgma}}, \code{\link{nj}}, \code{\link{boot.phylo}},
326-
#' \code{\link{nodelabels}}, \code{\link{tab}},
324+
#' @seealso \code{\link{bruvo.dist}}, \code{\link[adegenet]{nancycats}},
325+
#' \code{\link{upgma}}, \code{\link[ape]{nj}}, \code{\link[ape]{boot.phylo}},
326+
#' \code{\link[ape]{nodelabels}}, \code{\link[adegenet]{tab}},
327327
#' \code{\link{missingno}}.
328328
#'
329329
#' @details This function will calculate a tree based off of Bruvo's distance
@@ -455,7 +455,7 @@ bruvo.boot <- function(pop, replen = 1, add = TRUE, loss = TRUE, sample = 100,
455455
#' Create minimum spanning network of selected populations using Bruvo's
456456
#' distance.
457457
#'
458-
#' @param gid a \code{\link{genind}} or \code{\link{genclone}} object
458+
#' @param gid a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
459459
#'
460460
#' @param replen a \code{vector} of \code{integers} indicating the length of the
461461
#' nucleotide repeats for each microsatellite locus.
@@ -516,7 +516,7 @@ bruvo.boot <- function(pop, replen = 1, add = TRUE, loss = TRUE, sample = 100,
516516
#' used to filter un-contracted data sets.
517517
#' }
518518
#'
519-
#' @seealso \code{\link{bruvo.dist}}, \code{\link{nancycats}},
519+
#' @seealso \code{\link{bruvo.dist}}, \code{\link[adegenet]{nancycats}},
520520
#' \code{\link{plot_poppr_msn}}, \code{\link[igraph]{mst}}
521521
#' \code{\link{bruvo.boot}}, \code{\link{greycurve}} \code{\link{poppr.msn}}
522522
#'
@@ -663,7 +663,7 @@ bruvo.msn <- function (gid, replen = 1, add = TRUE, loss = TRUE,
663663
#'
664664
#' This function will test for consistency in the sense that all alleles are
665665
#' able to be represented as discrete units after division and rounding.
666-
#' @param gid a \code{\link{genind}} or \code{\link{genclone}} object
666+
#' @param gid a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
667667
#' @param replen a numeric vector of repeat motif lengths.
668668
#' @return a logical vector indicating whether or not the repeat motif length is
669669
#' consistent.
@@ -711,7 +711,7 @@ consistent_replen <- function(index, alleles, replen){
711711
#'
712712
#' Attempts to fix inconsistent repeat lengths found by \code{test_replen}
713713
#'
714-
#' @param gid a \code{\link{genind}} or \code{\link{genclone}} object
714+
#' @param gid a \code{\link[adegenet]{genind}} or \code{\link{genclone}} object
715715
#' @param replen a numeric vector of repeat motif lengths.
716716
#' @param e a number to be subtracted or added to inconsistent repeat lengths to
717717
#' allow for proper rounding.

R/classes.r

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ setClassUnion("mlgORnumeric", c("MLG", "numeric"))
5050
#' GENclone and SNPclone classes
5151
#'
5252
#' @description \strong{GENclone} is an S4 class that extends the
53-
#' \code{\linkS4class{genind}} object.\cr \strong{SNPclone} is an S4 class
54-
#' that extends the \code{\linkS4class{genlight}} object.\cr\cr They will have
53+
#' \code{\link[adegenet:genind-class]{genind}} object.\cr \strong{SNPclone} is an S4 class
54+
#' that extends the \code{\link[adegenet:genlight-class]{genlight}} object.\cr\cr They will have
5555
#' all of the same attributes as their parent classes, but they will contain
5656
#' one extra slot to store extra information about multilocus genotypes.
5757
#'
5858
#' @section Extends: The \code{genclone} class extends class
59-
#' \code{"\linkS4class{genind}"}, directly. \cr The \code{snpclone} class
60-
#' extends class \code{"\linkS4class{genlight}"}, directly.
59+
#' \code{"\link[adegenet:genind-class]{genind}"}, directly. \cr The \code{snpclone} class
60+
#' extends class \code{"\link[adegenet:genlight-class]{genlight}"}, directly.
6161
#'
6262
#' @details The genclone and snpclone classes will allow for more optimized
6363
#' methods of clone correction.
6464
#'
65-
#' Previously for \linkS4class{genind} and \linkS4class{genlight} objects,
65+
#' Previously for \link[adegenet:genind-class]{genind} and \link[adegenet:genlight-class]{genlight} objects,
6666
#' multilocus genotypes were not retained after a data set was subset by
6767
#' population. The new \strong{\code{mlg}} slot allows us to assign the
6868
#' multilocus genotypes and retain that information no matter how we subset
@@ -85,7 +85,7 @@ setClassUnion("mlgORnumeric", c("MLG", "numeric"))
8585
#' object of class \code{\linkS4class{MLG}}.
8686
#' @author Zhian N. Kamvar
8787
#' @seealso \code{\link{as.genclone}} \code{\link{as.snpclone}}
88-
#' \code{\linkS4class{genind}} \code{\linkS4class{genlight}}
88+
#' \code{\link[adegenet:genind-class]{genind}} \code{\link[adegenet:genlight-class]{genlight}}
8989
#' \code{\link[adegenet:accessors]{strata}} \code{\link[adegenet:accessors]{setPop}}
9090
#' \code{\link{MLG}} \code{\link{mll}} \code{\link{mlg.filter}}
9191
#' @import methods
@@ -186,7 +186,7 @@ setClass(
186186
#' An internal object used for bootstrapping. Not intended for user interaction.
187187
#'
188188
#' @section Extends:
189-
#' Virtual Class \code{"\linkS4class{gen}"}.
189+
#' Virtual Class \code{"\link[adegenet:gen-class]{gen}"}.
190190
#'
191191
#' @name bootgen-class
192192
#' @rdname bootgen-class

R/data_subset.r

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#' This function removes any duplicated multilocus genotypes from any specified
4949
#' population strata.
5050
#'
51-
#' @param pop a \code{\linkS4class{genind}}, \code{\linkS4class{genclone}}, or
51+
#' @param pop a \code{\link[adegenet:genind-class]{genind}}, \code{\linkS4class{genclone}}, or
5252
#' \code{\linkS4class{snpclone}} object
5353
#'
5454
#' @param strata a hierarchical formula or numeric vector. This will define the
@@ -65,7 +65,7 @@
6565
#' can set \code{keep = c(1,3)}.
6666
#'
6767
#' @return a clone corrected \code{\linkS4class{genclone}},
68-
#' \code{\linkS4class{snpclone}}, or \code{\linkS4class{genind}} object.
68+
#' \code{\linkS4class{snpclone}}, or \code{\link[adegenet:genind-class]{genind}} object.
6969
#'
7070
#' @details This function will clone correct based on the stratification
7171
#' provided. To clone correct indiscriminately of population structure, set
@@ -205,8 +205,8 @@ clonecorrect <- function(pop, strata = 1, combine = FALSE, keep = 1){
205205
#' Create a new dataset with specified populations or exclude specified
206206
#' populations from the dataset.
207207
#'
208-
#' @param gid a \code{\linkS4class{genind}}, \code{\linkS4class{genclone}},
209-
#' \code{\linkS4class{genlight}}, or \code{\linkS4class{snpclone}} object.
208+
#' @param gid a \code{\link[adegenet:genind-class]{genind}}, \code{\linkS4class{genclone}},
209+
#' \code{\link[adegenet:genlight-class]{genlight}}, or \code{\linkS4class{snpclone}} object.
210210
#'
211211
#' @param sublist a \code{vector} of population names or indexes that the user
212212
#' wishes to keep. Default to \code{"ALL"}.
@@ -351,7 +351,7 @@ popsub <- function(gid, sublist="ALL", exclude=NULL, blacklist=NULL, mat=NULL, d
351351
#' missingno gives the user four options to deal with missing data: remove loci,
352352
#' remove samples, replace with zeroes, or replace with average allele counts.
353353
#'
354-
#'@param pop a \code{\linkS4class{genclone}} or \code{\linkS4class{genind}}
354+
#'@param pop a \code{\linkS4class{genclone}} or \code{\link[adegenet:genind-class]{genind}}
355355
#' object.
356356
#'
357357
#'@param type a \code{character} string: can be "ignore", "zero", "mean",
@@ -370,7 +370,7 @@ popsub <- function(gid, sublist="ALL", exclude=NULL, blacklist=NULL, mat=NULL, d
370370
#' instead.
371371
#'
372372
#'@details These methods provide a way to deal with systematic missing data and
373-
#' to give a wrapper for \code{adegenet}'s \code{ \link{tab}} function.
373+
#' to give a wrapper for \code{adegenet}'s \code{ \link[adegenet]{tab}} function.
374374
#' ALL OF THESE ARE TO BE USED WITH CAUTION.
375375
#'
376376
#' Using this function with polyploid data (where missing data is coded as "0")
@@ -389,7 +389,7 @@ popsub <- function(gid, sublist="ALL", exclude=NULL, blacklist=NULL, mat=NULL, d
389389
#' more diversity.}
390390
#' }
391391
#' }
392-
#'@return a \code{\linkS4class{genclone}} or \code{\linkS4class{genind}} object.
392+
#'@return a \code{\linkS4class{genclone}} or \code{\link[adegenet:genind-class]{genind}} object.
393393
#'
394394
#'@note \emph{"wild missingno appeared!"}
395395
#'
@@ -513,12 +513,12 @@ missingno <- function(pop, type = "loci", cutoff = 0.05, quiet=FALSE, freq = FAL
513513
#' Remove all non-phylogentically informative loci
514514
#'
515515
#' This function will facilitate in removing phylogenetically uninformative loci
516-
#' from a \code{\linkS4class{genclone}} or \code{\linkS4class{genind}} object.
516+
#' from a \code{\linkS4class{genclone}} or \code{\link[adegenet:genind-class]{genind}} object.
517517
#' The user has the ability to define what uninformative means by setting a
518518
#' cutoff value for either percentage of differentiating genotypes or minor
519519
#' allele frequency.
520520
#'
521-
#' @param pop a \code{\linkS4class{genclone}} or \code{\linkS4class{genind}}
521+
#' @param pop a \code{\linkS4class{genclone}} or \code{\link[adegenet:genind-class]{genind}}
522522
#' object.
523523
#'
524524
#' @param cutoff \code{numeric}. A number from 0 to 1 defining the minimum
@@ -658,12 +658,12 @@ informloci <- function(pop, cutoff = 2/nInd(pop), MAF = 0.01, quiet = FALSE){
658658
#' diversity statistics. The tradeoff was the fact that this broke all other
659659
#' analyses as they relied on allele frequencies and the missing alleles are
660660
#' treated as extra alleles. This function removes those alleles and returns a
661-
#' \code{\linkS4class{genclone}} or \code{\linkS4class{genind}} object where
661+
#' \code{\linkS4class{genclone}} or \code{\link[adegenet:genind-class]{genind}} object where
662662
#' allele frequencies are coded based on the number of alleles observed at a
663663
#' single locus per individual. See the examples for more details.
664664
#'
665-
#' @param poly a \code{\linkS4class{genclone}}, \code{\linkS4class{genind}}, or
666-
#' \code{\linkS4class{genpop}} object that has a ploidy of > 2
665+
#' @param poly a \code{\linkS4class{genclone}}, \code{\link[adegenet:genind-class]{genind}}, or
666+
#' \code{\link[adegenet:genpop-class]{genpop}} object that has a ploidy of > 2
667667
#' @param newploidy for genind or genclone objects: if \code{FALSE} (default),
668668
#' the user-defined ploidy will stay constant. if \code{TRUE}, the ploidy for
669669
#' each sample will be determined by the maximum ploidy observed for each
@@ -673,8 +673,8 @@ informloci <- function(pop, cutoff = 2/nInd(pop), MAF = 0.01, quiet = FALSE){
673673
#' if \code{TRUE}, objects with uneven ploidies will have zeroes appended to all
674674
#' loci to allow conversion to genpop objects. Defaults to \code{FALSE}.
675675
#'
676-
#' @return a \code{\linkS4class{genclone}}, \code{\linkS4class{genind}}, or
677-
#' \code{\linkS4class{genpop}} object.
676+
#' @return a \code{\linkS4class{genclone}}, \code{\link[adegenet:genind-class]{genind}}, or
677+
#' \code{\link[adegenet:genpop-class]{genpop}} object.
678678
#'
679679
#' @details The genind object has two caveats that make it difficult to work
680680
#' with polyploid data sets:

R/distances.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#' individuals who share half of the same alleles will have a distance of 0.5.
5353
#' This function can analyze distances for any marker system.
5454
#'
55-
#' @param x a \code{\link{genind}} object.
55+
#' @param x a \code{\link[adegenet]{genind}} object.
5656
#'
5757
#' @param percent \code{logical}. Should the distance be represented as a
5858
#' percent? If set to \code{FALSE} (default), the distance will be reflected
@@ -139,7 +139,7 @@ diss.dist <- function(x, percent=FALSE, mat=FALSE){
139139
#' These functions are modified from the function \link[adegenet]{dist.genpop} to
140140
#' be applicable for distances between individuals.
141141
#'
142-
#' @param x a \linkS4class{genind}, \linkS4class{genclone}, or matrix object.
142+
#' @param x a \link[adegenet:genind-class]{genind}, \linkS4class{genclone}, or matrix object.
143143
#'
144144
#' @param warning If \code{TRUE}, a warning will be printed if any infinite
145145
#' values are detected and replaced. If \code{FALSE}, these values will be
@@ -163,7 +163,7 @@ diss.dist <- function(x, percent=FALSE, mat=FALSE){
163163
#' compatibility.
164164
#'
165165
#' These distances were adapted from the \pkg{adegenet} function
166-
#' \code{\link{dist.genpop}} to work with \code{\linkS4class{genind}} objects.
166+
#' \code{\link[adegenet]{dist.genpop}} to work with \code{\link[adegenet:genind-class]{genind}} objects.
167167
#'
168168
#' @seealso \code{\link{aboot}} \code{\link{diss.dist}} \code{\link{poppr.amova}}
169169
#' @rdname genetic_distance

R/filter_stats.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
#' This function is a wrapper to mlg.filter. It will calculate all of the stats
4848
#' for mlg.filter utilizing all of the algorithms.
4949
#'
50-
#' @param x a \code{\link{genind}}, \code{\link{genclone}},
51-
#' \code{\link{genlight}}, or \code{\link{snpclone}} object
50+
#' @param x a \code{\link[adegenet]{genind}}, \code{\link{genclone}},
51+
#' \code{\link[adegenet]{genlight}}, or \code{\link{snpclone}} object
5252
#' @param distance a distance function or matrix
5353
#' @param threshold a threshold to be passed to \code{\link{mlg.filter}}
5454
#' (Default: 1e6)

0 commit comments

Comments
 (0)