[Bioc-devel] using and importing CRAN package functions from "plyr"
On 10/27/2011 12:12 AM, Andreas Heider wrote:
Dear BioC-Devel mailing list,
my package makes use of the "recast" function from the "reshape" R-package.
I have imported the function in the NAMESPACE with "importFrom("reshape",
recast, melt, cast, sort_df)". So this worked out quite well.
But this function relies on the "is.formula" function from the "plyr"
R-package. So I tried to import this function along whith its dependancies
in the NAMESPACE.
Now this did not work for me. I have tried "import(plyr)",
"importFrom("plyr", is.formula, rbind.fill)" in the NAMESPACE and "Depends:
plyr" in the DESCRIPTION.
At the moment of writing only "Depends: plyr" works for me.
Any attempt of importing the function results in the following error when
checking the package:
Error in recast(data = exprs_z, formula = identifier ~ variable,
collapse_fun) :
could not find function "is.formula"
Calls: virtualArray.build_fData -> recast
Maybe someone has encountered similar problems and can help me out of this.
Hi Andreas --
'reshape' has been replaced by 'reshape2'; I think you'll have more luck
with that.
For what it's worth, 'reshape' doesn't import anything into its own
namespace
> getNamespaceImports("reshape")
$base
[1] TRUE
When it tries to find is.formula, it looks in it's name space and then
on the search path, rather than in your name space (this is the right
thing to do -- you don't want reshape's search path to be disrupted by
your package). So whatever functions reshape needs have to be found on
the search path, hence Depends: plyr.
Martin
Thanks in advance, Andreas Heider [[alternative HTML version deleted]]
_______________________________________________ Bioc-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793