If your file only contains the lines that you provided, it is ignored by roxygen2. You should add a line after the roxygen code that contains just NULL
. So the following should work:
#' @import reshape2 ggplot2 DESeq2 geneplotter
#' @import survcomp gplots pheatmap RColorBrewer
NULL
I have also reduced the number of lines to show you, how several packages can be imported with a single use of @import
. But it does not matter for roxygen, on how many lines you distribute the packages.
I think the reason for this is that the roxygen sections must be associated with some R object. For example, the documentation of a function is associated with the corresponding function object. Since you don't want to have the imports associated with a function, you can associate them with NULL
, which is an R object as well.
As hadley rightly points out, it is not recommended to fully import that many packages because you might end up with name conflicts. The following two alternatives are usually better:
Reference function with their explicit package name and the ::
operator: reshape2::melt()
This has the added advantage that you immediately see, from which package a function comes.
Import only the functions that you need from a package using @importFrom
:
#' @importFrom reshape2 melt cast
You can find more information here.
NAMESPACE
file, to force to recreate the file again. – Marvelmarvella