[R] dmvnorm masked by emdbook
Ben Bolker
bolker at ufl.edu
Sun Mar 14 15:43:44 CET 2010
Tobias Verbeke <tobias.verbeke <at> gmail.com> writes:
>
> Hi Dan,
>
> For this to work, the copula package should
> explicitly import dmvnorm from the mvtnorm
> package by including
>
> importFrom(mvtnorm, dmvnorm)
>
> in their NAMESPACE file.
>
> You can do the same thing and rebuild + reinstall
> the package to solve your problem quickly, but
> there might be some other imports of relevance
> (I cc'ed the maintainer).
>
> Best,
> Tobias
>
> jyan at stat.uconn.edu
> Daniel Murphy wrote:
> > I am using curve3d in the emdbook package to graph a gaussian copula density
> > function generated via the copula package. Unfortunately, it appears that
> > emdbook masks dmvnorm from the package mvtnorm in a way that prohibits
> > copula from generating the gaussian copula. (Sounds very confusing!) For
> > example,
> >> library(copula)
> >> f<-function(x,y) dcopula(normalCopula(0),c(x,y))
> >> library(emdbook)
> >> curve3d(f)
> > Error in dmvnorm(x, sigma = sigma) : unused argument(s) (sigma = sigma)
> >
> > Is there no way for me to use those two libraries together?
> >
(I'm the author/maintainer of the emdbook package.)
I named the variance-matrix parameter Sigma (rather than
sigma), by analogy with the mvrnorm() function in the MASS
package. I could rename it (possibly breaking existing code)
or add a synonymous sigma parameter, although I don't know how
much the additional complexity is worth it. I could also
add a NAMESPACE to the package so that one could specify
emdbook::curve3d so one could run curve3d without actually
loading the package ...
Ben Bolker (bolker AT ufl.edu)
More information about the R-help
mailing list