Skip to content
Prev 11124 / 21312 Next

[Bioc-devel] check returns error on multiple dependent functions

On 06/27/2017 05:19 PM, Arman Sh wrote:
Clean up the simple stuff first



* checking package dependencies ... NOTE
Depends: includes the non-default packages:
   'cgdsr' 'xlsxjars' 'xlsx' 'gplots' 'RColorBrewer' 'rafalib' 'Biobase'
   'genefilter'
Adding so many packages to the search path is excessive and importing
selectively is preferable.

only include packages that the end-user would need to invoke in the 
Depends: field, otherwise use Imports:



* checking R code for possible problems ... NOTE
...
Undefined global functions or variables:
   Stop colorRampPalette dev.off head i median na.omit png
   setTxtProgressBar simplifiction.cuttoff txtProgressBar
Consider adding
   importFrom("grDevices", "colorRampPalette", "dev.off", "png")
   importFrom("stats", "median", "na.omit")
   importFrom("utils", "head", "setTxtProgressBar", "txtProgressBar")
to your NAMESPACE file.

do as the instructions say and add the suggested statements to the 
NAMESPACE file.



* checking Rd line widths ... NOTE
Rd file 'heatmapOutput.Rd':
   \usage lines wider than 90 characters:
      heatmapOutput(submissionName, shortenStudyNames = TRUE, genelimit 
= "none", resolution = 600, RowCex = 0.8,
      ColCex = 0.8, heatmapMargines = c(10,10), angleForYaxisNames = 45, 
heatmapColor = "RdBu", reverseColor = TRUE,

wrap the lines to 90 characters max (80 is the norm, for easy reading in 
a plain terminal).



Your problem though likely comes from these

Found the following assignments to the global environment:
File 'cbaf/R/cbaf-automatedStatistics.R':
   assign(paste("Pa.PrData.", submissionName, sep = ""), newParameters,
     envir = globalenv())
...

It is VERY BAD PRACTICE to assign variables to the global environment, 
for exactly the reason you experience in your code -- the successful 
execution of your functions depends in a very precise and fragile way on 
the order in which they are called.

Make sure your functions are true 'functions' that rely ONLY on the 
input values and symbols defined or imported into the package. One 
possible approach is to return the parameter values as an object (e.g., 
an S4 class) that is then required for input into other functions.

Martin
This email message may contain legally privileged and/or...{{dropped:2}}