简体   繁体   中英

Error in match.arg(mvnTest) : 'arg' must be of length 1

Hi – I wish to run a CFA in r, currently checking off all the assumptions. I ran into problems when applying the following function:

mvn(vdata_clean1, subset = 'NULL', mvnTest = c("mardia", "hz", "royston"), 
covariance = TRUE, tol = 1e-25, alpha = 0.5, scale = FALSE, desc = TRUE, 
transform = "none", R = 1000, 
univariateTest = c("SW"), univariatePlot = c("qq", "persp", "contour"), 
multivariateOutlierMethod = "none", bc = FALSE, bcType = "rounded", 
showOutliers = FALSE, showNewData = FALSE)

I get this error below:

Error in match.arg(mvnTest) : 'arg' must be of length 1

Any ideas what I can do to run to function successfully? Grateful for any advice :)

The documentation for the mvnTest argument says: "select one of the MVN tests." You can't do three tests in one call. You'll need to call the function three times, once with each test type.

You may have been confused by the help page, which lists mvnTest = c("mardia", "hz", "royston", "dh", "energy") . It is a convention in R to list all possibilities, even though only one selection is allowed. You can't tell this just by looking at the usage, you need to read the rest of the help page (or recognize the error message).

I believe you'll run into the same problem with univariatePlot .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM