Skip to content

[R-sig-dyn-mod] error attaching package deSolve

5 messages · Darin Perusich, Julien Lavenus, Giorgio Garziano +1 more

#
Hello All,

Please bear with me, I'm a systems administrator helping an end user
troubleshoot a problem.

When attempting to load the deSolve library it's failing with the
message 'The following object is masked from ?package:graphics?:
matplot', however the graphics library is loaded, (.packages()) lists
it, see my output below. However if I manually load graphics and then
deSolve it's loads without issue.

Can anyone shed some light as to what might be causing this?

R-base 3.2.2
deSolve 1.13-1 installed via install.packages("deSolve",
repos="http://R-Forge.R-project.org")

The output that I'm seeing...

linux-4on9:~> R

R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-suse-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"
Attaching package: ?deSolve?

The following object is masked from ?package:graphics?:

    matplot
--
Later,
Darin
#
Dear Darin,

The package graphics is already loaded and attached when you start R. 
Because both packages contain an object called matplot, when you load 
deSolve, R re-associate the object name "matplot" with the matplot 
object from deSolve (matplot = deSolve::matplot). Therefore the matplot 
object from graphics (graphics::matplot) is not directly accessible 
anymore through the name matplot.

The library() function does not reload a namespace which is already 
loaded. Because the namespace of graphics is already loaded when you 
start R, it is not reloaded when you do library(graphics). This is why 
nothing happens when you do library(graphics).

Hope it helps.
Best,

Julien
On 08/01/16 16:30, Darin Perusich wrote:

  
    
#
Hi Darin,

I am adding some info to the previous answer.

The function matplot is defined in both graphics and deSolve packages.
See:

help(matplot, package="deSolve")
help(matplot, package="graphics")

You may specify the matplot implementation you intend to run by specifying the
associated package this way:

deSolve::matplot

graphics::matplot

See:

help("::")

Further details at:

http://r-pkgs.had.co.nz/namespace.html#undefined


Best,

--
GG
#
Hi Darin,

thanks for installing deSolve. The message that something is masked is 
normal intended behavior and NOT an error. It is not even a warning.

It just means that deSolve re-defines or extends the original behavior 
of function "matplot", to make it more user-friendly for deSolve 
objects. In case of package deSolve, "matplot" works as expected and 
users normally don't need to care about it, except another package 
introduces another incompatible redefinition. The notice makes you aware 
of this, so that you have the choice of trusting the package authors and 
just use:

matplot()

or if you don't trust them or in case of conflicting redefinitions from 
several loaded packages, you may consider to use:

graphics::matplot()

to get the original behavior.

Such redefinition/extension is sometimes unavoidable and in the interest 
of the user. Many other prominent packages do the same.

Regards,

Thomas
On 08.01.2016 16:30, Darin Perusich wrote:

  
    
#
Thanks for shedding light on that fact that this is nothing more than
an information message!
--
Later,
Darin


On Fri, Jan 8, 2016 at 10:50 AM, Thomas Petzoldt
<thomas.petzoldt at tu-dresden.de> wrote: