R/filterReport.R

Defines functions filterReport

Documented in filterReport

#' Filters a genetic value report down to only the specified animals
#'
## Copyright(c) 2017-2020 R. Mark Sharp
## This file is part of nprcgenekeepr
#'
#' @return A copy of report specific to the specified animals.
#'
#' @examples
#' \donttest{
#' library(nprcgenekeepr)
#' rpt <- nprcgenekeepr::pedWithGenotypeReport$report
#' rpt1 <- filterReport(c("GHH9LB", "BD41WW"), rpt)
#' }
#'
#' @param ids character vector of animal IDs
#' @param rpt a dataframe with required colnames \code{id}, \code{gu},
#' \code{zScores}, \code{import}, \code{totalOffspring}, which is
#' a data.frame of results from a genetic value analysis.
#' @export
filterReport <- function(ids, rpt) {
  return(rpt[rpt$id %in% ids, ])
}
rmsharp/nprcmanager documentation built on April 24, 2021, 3:13 p.m.