Skip to content

Commit 4f5fa4d

Browse files
committed
Fixing and expanding tests
1 parent f29d3eb commit 4f5fa4d

2 files changed

Lines changed: 201 additions & 83 deletions

File tree

R/AlphaPart.R

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616
#' AlphaPart partitions genetic values and their summaries to
1717
#' quantify the sources of genetic change in multi-generational pedigrees.
1818
#' The partitioning method is described in Garcia-Cortes et al. (2008)
19-
#' <doi:10.1017/S175173110800205X>. The package includes the
20-
#' main function AlphaPart for partitioning genetic values and auxiliary
21-
#' functions for manipulating data and summarizing, visualizing, and saving
22-
#' results.
19+
#' <doi:10.1017/S175173110800205X>. This method enables a retrospective genetic
20+
#' analysis of past changes in a population and is as such a counterpart to
21+
#' prospective genetic methods describing genetic change .
22+
#' The package includes the main function AlphaPart for
23+
#' partitioning genetic values and auxiliary functions for manipulating data and
24+
#' summarizing, visualizing, and saving results.
25+
#' Genetic values can be breeding values, allele dosages, or similar quantities.
2326
#'
24-
#' Please see the introductory vignette for instructions for using this package.
27+
#' See the introductory vignette for instructions on using this package.
2528
#' The vignette can be viewed using the following command:
26-
#' \code{vignette("intro",package="AlphaPart")}
29+
#' \code{vignette("intro", package = "AlphaPart")}
2730
#' @keywords internal
2831
"_PACKAGE"
2932

@@ -36,11 +39,11 @@
3639
#' bioscience. DOI: \doi{10.1017/S175173110800205X}
3740
#'
3841
#' @param x data.frame, with (at least) the following columns:
39-
#' individual, father, and mother identif ication, and year of birth;
42+
#' individual, father, and mother identification, and year of birth;
4043
#' see arguments \code{colId}, \code{colFid}, \code{colMid},
4144
#' \code{colPath}, and \code{colBV}; see also details about the
4245
#' validity of pedigree.
43-
#' @param pathNA Logical, set dummy path (to "XXX") where path
46+
#' @param pathNA Logical, set dummy path (to "UNKNOWN") where path
4447
#' information is unknown (missing).
4548
#' @param recode Logical, internally recode individual, father and,
4649
#' mother identification to \code{1:n} codes, while missing parents
@@ -62,11 +65,11 @@
6265
#' Parent 1 (say father), and one of Grandparents of Parent 2 (say
6366
#' maternal grandfather).
6467
#' @param colId Numeric or character, position or name of a column
65-
#' holding individual identif ication.
68+
#' holding individual identification.
6669
#' @param colFid Numeric or character, position or name of a column
67-
#' holding father identif ication.
70+
#' holding father identification.
6871
#' @param colMid Numeric or character, position or name of a column
69-
#' holding mother identif ication or maternal grandparent identif
72+
#' holding mother identification or maternal grandparent identif
7073
#' ication if \code{pedType="IPG"} .
7174
#' @param colPath Numeric or character, position or name of a column
7275
#' holding path information.
@@ -240,7 +243,7 @@ AlphaPart <- function(
240243
test <- !sapply(x[, c(colId, colFid, colMid)], is.numeric) & !recode
241244
if (any(test)) {
242245
stop(
243-
"argument 'recode' must be 'TRUE' when identif ications in 'x' are not numeric"
246+
"argument 'recode' must be 'TRUE' when identifications in 'x' are not numeric"
244247
)
245248
}
246249

@@ -341,7 +344,7 @@ AlphaPart <- function(
341344
if (any(test)) {
342345
if (pathNA) {
343346
x[, colPath] <- as.character(x[, colPath])
344-
x[test, colPath] <- "XXX"
347+
x[test, colPath] <- "UNKNOWN"
345348
} else {
346349
stop("unknown (missing) value for path not allowed; use 'pathNA=TRUE'")
347350
}
@@ -359,7 +362,7 @@ AlphaPart <- function(
359362
if (any(test)) {
360363
if (pathNA) {
361364
x[, colBy] <- as.character(x[, colBy])
362-
x[test, colBy] <- "XXX"
365+
x[test, colBy] <- "UNKNOWN"
363366
} else {
364367
stop("unknown (missing) value for group not allowed; use 'pathNA=TRUE'")
365368
}

0 commit comments

Comments
 (0)