Skip to content

Commit 9a92ca0

Browse files
reknit
1 parent 63ae064 commit 9a92ca0

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

R/buildmxPedigrees.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,14 @@ fitPedigreeModel <- function(
425425
#' Align Phenotype Vector to Matrix Format for OpenMx
426426
#'
427427
#' This function takes a pedigree data frame, a specified phenotype column, and a vector of IDs to keep, and returns a matrix formatted for use in OpenMx models. The resulting matrix has one row and columns corresponding to the specified IDs, with values taken from the phenotype column of the pedigree.
428-
#' @param ped A data frame representing the pedigree, containing at least the columns specified by \code{phenotype} and \code{id_col}.
428+
#' @param ped A data frame representing the pedigree, containing at least the columns specified by \code{phenotype} and \code{personID}.
429429
#' @param phenotype A character string specifying the column name in \code{ped} that
430430
#' contains the phenotype values to be aligned.
431-
#' @param keep_ids A vector of IDs for which the phenotype values should be extracted and aligned. These IDs should correspond to the values in the \code{id_col} of \code{ped}.
432-
#' @param id_col A character string specifying the column name in \code{ped} that contains the individual IDs. Default is "ID".
431+
#' @param keep_ids A vector of IDs for which the phenotype values should be extracted and aligned. These IDs should correspond to the values in the \code{personID} of \code{ped}.
432+
#' @param personID A character string specifying the column name in \code{ped} that contains the individual IDs. Default is "ID".
433433

434-
alignPhenToMatrix <- function(ped, phenotype, keep_ids, id_col = "ID") {
434+
alignPhenToMatrix <- function(ped, phenotype, keep_ids, personID = "ID") {
435435
obs_ids <- make.names(as.character(keep_ids))
436-
pheno_vals <- ped[[phenotype]][match(as.character(keep_ids), as.character(ped[[id_col]]))]
436+
pheno_vals <- ped[[phenotype]][match(as.character(keep_ids), as.character(ped[[personID]]))]
437437
matrix(as.double(pheno_vals), nrow = 1, dimnames = list(NULL, obs_ids))
438438
}

man/alignPhenToMatrix.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)