Skip to content
Prev 278294 / 398503 Next

On-demand importing of a package

Just for the records, the solution was to make the matrix 'dgCmatrix"
instead of 'dsCmatrix', 'dgCmatrix' works and 'dsCmatrix' does not. I
suspect that this has to do something with the S4 class hierarchy in
Matrix, but I am not sure.

This is a quite ugly workaround, since it depends on some internal
Matrix features, so I might end up just importing Matrix, as many of
you suggested in the first place....

However, I agree with Gabor Grotherdieck that the issue is still
there, in general.

Another example would be (optionally) using the 'snow' (or now
'parallel') package. I would like to add optional parallel processing
to some of my functions in a package, without actually requiring the
installation of snow/parallel. If snow is there and the user wants to
use it, then it is used, otherwise not.

Actually, 'snow' works similarly. It (optionally) calls function from
the Rmpi package, but Rmpi is only suggested, there is no hard
dependency. This seems to work well for snow, but in my case I the S4
features in Matrix interfere.

Gabor
On Tue, Nov 22, 2011 at 8:09 PM, G?bor Cs?rdi <csardi at rmki.kfki.hu> wrote: