@@ -163,6 +163,9 @@ max.scan1 <-
163163# ' @param map A list of vectors of marker positions, as produced by
164164# ' [insert_pseudomarkers()].
165165# ' @param chr Optional vector of chromosomes to consider.
166+ # ' @param lodcolumn An integer or character string indicating the LOD
167+ # ' score column, either as a numeric index or column name.
168+ # ' If `NULL`, return maximum for all columns.
166169# '
167170# ' @export
168171# ' @return A single number: the maximum LOD score across all columns and positions for
@@ -193,7 +196,7 @@ max.scan1 <-
193196# ' # maximum on chromosome 2
194197# ' maxlod(out, map, "2")
195198maxlod <-
196- function (scan1_output , map = NULL , chr = NULL )
199+ function (scan1_output , map = NULL , chr = NULL , lodcolumn = NULL )
197200{
198201 if (is.null(scan1_output )) stop(" scan1_output is NULL" )
199202
@@ -206,6 +209,10 @@ maxlod <-
206209 scan1_output <- subset(scan1_output , map = map , chr = chr )
207210 }
208211
212+ if (! is.null(lodcolumn )) {
213+ scan1_output <- subset(scan1_output , lodcolumn = lodcolumn )
214+ }
215+
209216 # to handle output of either scan1() or scan1coef()
210217 # for coef(), look at the sign
211218 if (inherits(scan1_output , " scan1coef" )) {
0 commit comments