[BioC] Making data visible in packages (no visible binding for global variable ...)
Henrik Bengtsson
hb at stat.berkeley.edu
Wed Oct 29 01:46:39 CET 2008
On Tue, Oct 28, 2008 at 8:52 AM, Tarca, Adi <atarca at med.wayne.edu> wrote:
>
> Thanks Richard,
> It is indeed true that I do not get anymore "no visible binding"
> message, but the script does not work anymore :).
> I guess what happens is that, when the function tries to use X, it will
> get the one defined in the function first (which is NULL)and not look
> anymore for it the the global environment where the data() call will
> bring it up and initialize it with the real values.
Easy...
X <- NULL; rm(X);
data(myX);
/Henrik
> Regards,
> Adi
>
>
>
>
>
> -----Original Message-----
> From: Richard Pearson [mailto:richard.pearson at postgrad.manchester.ac.uk]
>
> Sent: Tuesday, October 28, 2008 5:38 AM
> To: Tarca, Adi
> Cc: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] Making data visible in packages (no visible binding
> for global variable ...)
>
> Adi
>
> A rather inelegant way to avoid the "no visible binding" message is:
>
> X <- NULL
> data(myX)
>
> Regards
>
> Richard
>
>
> Tarca, Adi wrote:
>> Hi all,
>> I am trying to write a package that contains one function MYF which
>> requires some data (e.g. a matrix X).
>> I put the matrix X in the \data folder as a myX.Rdata file. The
>> function MYF makes a data(myX) call to make X available within MYF
>> before doing some computations.
>> The resulting package gets installed and runs fine but when I do the R
>
>> CMD CHECK I get "no visible binding for global variable X".
>> I have two questions:
>> A) is there a better way to make X visible within MYF rather than
>> making a data() call
>> B) wht should be done to fix the "no visible binding for global
>> variable".
>>
>> Thanks,
>>
>> Adi Tarca
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
> --
> Richard D. Pearson richard.pearson at postgrad.manchester.ac.uk
> School of Computer Science, http://www.cs.man.ac.uk/~pearsonr
> University of Manchester, Tel: +44 161 275 6178
> Oxford Road, Mob: +44 7971 221181
> Manchester M13 9PL, UK. Fax: +44 161 275 6204
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
More information about the Bioconductor
mailing list