knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
require(PedigreeFromTvdData) require(dplyr) require(magrittr)
This document describes a function implementing different functions to check and transform a pedigree. A general description of the strategies is available in a separate vignette on Pedigree Checks - Concepts and Strategies. Further description about the consistency checks implementation is available on Pedigree Checks - Implementations and a description about the transformation implementation is available on Pedigree Transformation - Implementations.
sDataFileErrors <- system.file(file.path("extdata","KLDAT_20170524_AllFehler.txt"), package = "PedigreeFromTvdData") (tbl_transform_ped <- build_check_pedigree_from_tvd(ps_tvd_file = sDataFileErrors))
All dupicate are deleted;
Parent and offspring birthdates are set to NA, if a parent is not older as offspring;
Animal sex is set to NA, if the sex is incorrect;
Animal record is deleted, if his TVD format is incorrect;
Parent is set to NA, if it's TVD format is incorrect;
Birthdate is set to NA, if the birthdate format is incorrect.
Time how long is this function running.
sDataFileName <- system.file(file.path("extdata","KLDAT_20170524_10000.txt"), package = "PedigreeFromTvdData") (mb.main <- microbenchmark::microbenchmark( data.base = PedigreeFromTvdData::build_check_pedigree_from_tvd(ps_tvd_file = sDataFileName, pvec_format = getK11ColPositionVecFromDsch()), times = 5, unit = "s"))
Overview of results The following table shows the median times (column MedianTime) in seconds for the function that was used.
vecMethods <- c("PedigreeFromTvdData::build_check_pedigree_from_tvd") vecMedTimes <- c(mb.main$time) nMinTime <- vecMedTimes[order(vecMedTimes)] dfMedTime <- data.frame(Methode = vecMethods, MedianTime = round(vecMedTimes*10^(-9), digits = 4)) knitr::kable(dfMedTime)
r paste(Sys.time(),paste0("(", Sys.info()[["user"]],")" ))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.