Skip to content

Commit a13b486

Browse files
committed
set to M2* to avoid unnecessary error
1 parent 6ea29bb commit a13b486

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/M2.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,12 @@ M2 <- function(obj, type="M2*", calcNull = TRUE, quadpts = NULL, theta_lim = c(-
353353
#main
354354
if(residmat) type <- "M2*"
355355
stopifnot(type %in% c('M2*', 'M2', 'C2'))
356-
if(type == "M2")
356+
if(all(extract.mirt(obj, 'K') == 2)) type <- 'M2*'
357+
if(type == "M2"){
357358
if(!all(extract.mirt(obj, 'K') == 2L))
358359
stop("M2 statistic currently not supported for polytomous data. Use M2* or C2 instead",
359360
call.=FALSE)
361+
}
360362
if(missing(obj)) missingMsg('obj')
361363
if(is(obj, 'MixedClass'))
362364
stop('MixedClass objects are not yet supported', call.=FALSE)

0 commit comments

Comments
 (0)