> Thanks for your kind response Duncan. To be more specific, I'm using the
> function mvrnorm from MASS. The issue is that MASS depends on survival and
> I have a function in my package named tt() which conflicts with a function
> in survival of the same name. I can think of 2 alternatives solutions to my
> problem, but I'm to an expert:
>
> 1) Copy mvrnorm into my package, which I thought was not a good idea
> 2) Rename my tt() function to something else in my package, but this is
> painful as I have it all over the place in other functions.

3) Use namespaces: in your DESCRIPTION add `Import: MASS`, and in your
NAMESPACE add `importFrom(MASS,mvrnorm)`

Then you can access mvrnorm from your package, but it won't be made
available to the user who loads your package, and it won't pull in any
other functions from MASS or survival either.

Hadley


-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to