Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building R package: no visible global function definition for 'subject'

Tags:

package

r

I'm building an R package for the first time and am having some trouble. I am doing an R CMD Check and am getting the following error:

get.AlignedPositions: no visible global function definition for 'subject'

I am not sure what is causing this. I don't even have a "subject" variable in my code. The code is rather lengthy so I rather not paste all of it unless someone asks in a comment. Is there something specific I should look for? The only thing I can think of is that I have a line like this:

alignment <-pairwiseAlignment(pattern = canonical.protein, subject=protein.extracted, patternQuality=patternQuality,
                            subjectQuality=subjectQuality,type = type, substitutionMatrix= substitutionMatrix,
                            fuzzyMatrix=fuzzyMatrix,gapOpening=gapOpening,gapExtension=gapExtension,
                            scoreOnly=scoreOnly)

but subject is defined by the pairwiseAlignment function in the Biostrings package. Thank you for your help!

like image 964
user1357015 Avatar asked Jun 07 '12 03:06

user1357015


1 Answers

R spotted a function, subject, being used without a function called subject being available. One possible reason for this is explained in this discussion on R-devel. In that case code is used conditionally, e.g. if a certain package is installed we use its functionality. When checking the package on a system which does not have this package installed, we run in to these kinds of warnings. So please check if this might be the case. Alternatively, you might have made a mistake by calling subject while no function existed, e.g. subject was not a function but just an object.

like image 60
Paul Hiemstra Avatar answered Nov 04 '22 15:11

Paul Hiemstra