3

When I use R ROCR package, I got error message.

Loading required package: ROCR
Loading required package: gplots

Attaching package: ‘gplots’

The following object is masked from ‘package:stats’:

lowess

What should I do? I use R 3.1.3, OSX 10.11.6, and Rstudio 0.98.1103.

rrkk
  • 437
  • 1
  • 5
  • 15
  • This is not an error, it's just a warning that if you use `lowess()`, by default it will be the function that comes from the package `gplots`. If you want to use the one defined in `stats`, you'll have to do `stats::lowess()` – Rhesous Aug 17 '16 at 12:38
  • 1
    This link is very informative. Thank you. – rrkk Aug 17 '16 at 14:33
  • Canonical version of this question: http://stackoverflow.com/q/39137110/134830 – Richie Cotton Aug 27 '16 at 14:14

2 Answers2

2

that is because both 'gplots' and 'stats' export a function called 'lowess'. Since 'ROCR' loads after 'stats', the 'lowess' version of 'gplots' masks the presence of the version in 'stats'. You can access both by using the scope resolution operator '::' to distinguish between the two.

stats::lowess(...)
gplots::lowess(...)
2

Its not an error message. Basically you can have functions that can have same names. Lets say I write a function named sum() in a package named summer. This function named sum() can add two numbers only at a time. But base R already has a package named sum, it is masked from base. Meaning whenever you call sum, now the function sum() in the package summer is called. Hope it helps.

Dinesh.hmn
  • 713
  • 7
  • 21