3

I am trying to remove outliers from my dataset using the mvOutliers function in MVN in R. However, upon executing the program, I get the error, could not find function "mvOutlier".

I have installed all the packages from MVN to mvoutlier. I have also imported MVN but also tried importing mvoutlier but still I am getting the same error.

I am using the following code for outlier removal

library(MVN)
M <- mvOutlier(data, method = "quan", label = TRUE)
Comb_Data=M$newData

I expect the Comb_Data to contain the outlier free dataset but all I am getting is the error:

Error in mvOutlier(dat, method = "quan", label = TRUE) : could not find function "mvOutlier"

Any help in this matter would be appreciated.

Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
sumitpal0593
  • 194
  • 1
  • 3
  • 18
  • I don't see a function with the name `mvOutlier` in the `MVN` package. In fact I don't see any package with a function named `mvOutlier`. Is there a reason you think it exists? Is it documented somewhere? – MrFlick Apr 24 '19 at 16:58
  • It's here: http://www.et.bs.ehu.es/cran/web/packages/MVN/MVN.pdf and also here: https://www.rdocumentation.org/packages/MVN/versions/4.0/topics/mvOutlier – sumitpal0593 Apr 24 '19 at 17:02
  • @MrFlick `getAnywhere(mvOutlier)` does return something. And so does `MVN:::mvOutlier()`. But the function is not exported from namespace:MVN. – Rui Barradas Apr 24 '19 at 17:03
  • That's documentation is for an old version of the package. That doesn't exist in the newest >5.0 versions. Maybe you need this [how to install old versions of packages](https://stackoverflow.com/questions/17082341/installing-older-version-of-r-package) – MrFlick Apr 24 '19 at 17:03
  • Is there any newer version of MVN or outlier removal in general? – sumitpal0593 Apr 24 '19 at 17:06
  • Run `MVN:::mvOutlier`, with **3** colons. But I have just tested with the package on CRAN and the example in your link does not work. There is something wrong with that package and you should write `maintainer("MVN")`. – Rui Barradas Apr 24 '19 at 17:10
  • Just read that vignette for that package `vignette(MVN)`. The function doesn't exist any more, but the features were just moved into the `mvn()` function itself. Try `mvn(data, mvnTest="hz", multivariateOutlierMethod = "quan")` – MrFlick Apr 24 '19 at 17:11
  • @MrFlick with that function, will Comb_Data=M$newData work? – sumitpal0593 Apr 24 '19 at 17:22

0 Answers0