This filters data that has both repeats (e.g. multiple images on the same day) and (optionally) longitudinal data. The quality measure should be a "higher is better" measurement. This function can be called recursively until it converges. It is less aggressive than highestQualityRepeat.

rejectLowestQualityRepeat(mxdfin, idvar, visitvar, qualityvar, verbose = FALSE)

Arguments

mxdfin

Input data frame with repeated measurements and a grouped time variable

idvar

variable name for unique subject identifier column

visitvar

variable name for the visit or date column

qualityvar

variable name for the quality column; higher values should map to higher quality data.

verbose

boolean

Value

data frame

Author

Avants BB

Examples

mydf = generateSubtyperData( 100 )
mydfhq = rejectLowestQualityRepeat( mydf, "Id", "visit", "quality")