Skip to content

Commit

Permalink
Update documentation for #112
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Oct 15, 2016
1 parent 32ebe40 commit 8a33fa5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
23 changes: 22 additions & 1 deletion R/bootstraping.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
#' \code{\link{prevosti.dist}} \code{\link{diss.dist}}
#' \code{\link{bruvo.boot}} \code{\link[ape]{boot.phylo}}
#' \code{\link[adegenet]{dist.genpop}} \code{\link{dist}}
#' \code{\link{bootgen2genind}} \code{\linkS4class{bootgen}}
#'
#' @export
#' @keywords bootstrap
Expand All @@ -137,10 +138,30 @@
#'
#' set.seed(9999)
#' # Generate a tree using custom distance
#' bindist <- function(x) dist(x$tab, method = "binary")
#' bindist <- function(x) dist(tab(x), method = "binary")
#' binnan <- aboot(nan9, dist = bindist)
#'
#' \dontrun{
#' # Distances from other packages.
#' #
#' # Sometimes, distance functions from other packages will have the constraint
#' # that the incoming data MUST be genind. Internally, aboot uses the
#' # bootgen class ( class?bootgen ) to shuffle loci, and will throw an error
#' # The function bootgen2genind helps fix that. Here's an example of a function
#' # that expects a genind class from above
#' bindist <- function(x){
#' stopifnot(is.genind(x))
#' dist(tab(x), method = "binary")
#' }
#' #
#' # Fails:
#' # aboot(nan9, dist = bindist)
#' ## Error: is.genind(x) is not TRUE
#' #
#' # Add bootgen2genind to get it working!
#' # Works:
#' aboot(nan9, dist = function(x) bootgen2genind(x) %>% bindist)
#'
#' # AFLP data
#' data(Aeut)
#'
Expand Down
2 changes: 2 additions & 0 deletions R/poppr.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
#' \item \code{\link{read.genalex}} (x) - Reads GenAlEx formatted csv files to a genind object
#' \item \code{\link{genind2genalex}} (m) - Converts genind objects to GenAlEx formatted csv files
#' \item \code{\link{genclone2genind}} (m) - Removes the @@mlg slot from genclone objects
#' \item \code{\link{genclone2genind}} (m) - Removes the @@mlg slot from genclone objects
#' \item \code{\link{bootgen2genind}} (x) - see \code{\link{aboot}} for details)
#' }
#' @section Data manipulation:
#' \itemize{
Expand Down
23 changes: 22 additions & 1 deletion man/aboot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/poppr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8a33fa5

Please sign in to comment.