[R-pkg-devel] no visible binding for global variable ‘degree_C’ - CRAN check note

EcoC2S - Irucka Embry |embry @end|ng |rom ecocc@@com
Tue Dec 13 23:13:50 CET 2022


Alexandre, thank you for your inquiry and for your help; however, I 
don't have the issue anymore as I declared degree_C as a global variable 
in the functions where the note occurred.

Thank you.

Irucka



On 12-12-2022 10:26, Alexandre Courtiol wrote:
> Irucka,
> If you saw still have the note "no visible binding for global variable
> ‘degree_C’", it implies that somewhere in your package degree_C is
> still unquotted...
> 
> Do you have your code online for us to help you more effectively?
> ++
> 
> On Mon, 12 Dec 2022 at 17:20, EcoC2S - Irucka Embry
> <iembry using ecoccs.com> wrote:
> 
>> Hi Iñaki and Andrew, I'm sorry, I'll clarify my statement here.
>> 
>> set_units(T, "degree_C") still produced the R CMD check note, but it
>> 
>> works with regards to setting the unit for the R expression.
>> 
>> I replaced every instance of set_units(T, degree_C) with
>> set_units(T,
>> "degree_C") in a single function (I use the units package throughout
>> 
>> many functions in my iemisc package) & than I ran R CMD check again.
>> I
>> looked for that particular function in the "checking R code for
>> possible
>> problems ..." section and I still saw the function name with this
>> note:
>> no visible binding for global variable ‘degree_C’.
>> 
>> Using the global variables option does prevent the note from
>> occurring
>> in all of my other functions where I set units.
>> 
>> I hope that this clarification helps.
>> 
>> On a side note, I used the units package in other functions;
>> however, I
>> have not ever seen a note for the same usage in other functions. I
>> don't
>> know why the same usage of the units package in some functions draws
>> a
>> note while in other functions there is no note.
>> 
>> Thank you.
>> 
>> Irucka
>> 
>> On 12-12-2022 09:58, Iñaki Ucar wrote:
>>> On Mon, 12 Dec 2022 at 16:43, EcoC2S - Irucka Embry
>> <iembry using ecoccs.com>
>>> wrote:
>>>> 
>>>> Hi Andrew, set_units(T, "degree_C") does not work;
>>> 
>>> Sorry, do you mean that the code fails? Or the code works but you
>>> still see the NOTE? In this case, it is possible that you didn't
>>> replace all the instances of set_units(T, degree_C) in your files.
>>> 
>>> Iñaki
>>> 
>>>> however, setting
>>>> degree_C as a global variable does work.
>>>> 
>>>> Thank you for your suggestion.
>>>> 
>>>> Irucka
>>>> 
>>>> 
>> 
>> On 12-12-2022 09:56, Alexandre Courtiol wrote:
>>> Hi Irucka,
>>> using text to define the unit is valid, so I don't see why it
>> would
>>> not work.
>>> It would be better than defining a global variable.
>>> 
>>> ``` rT <- 2
>>> units::set_units(T, "degree_C")
>>> #> 2 [°C]
>>> ```
>>> <sup>Created on 2022-12-12 with [reprex
>>> v2.0.2](https://reprex.tidyverse.org)</sup>
>>> 
>>> ++
>>> 
>> 
>>>> On 11-12-2022 00:29, Andrew Simmons wrote:
>>>>> You can declare degree_C as a variable before using
>> set_units():
>>>>> 
>>>>> degree_C <- NULL
>>>>> set_units(T, degree_C)
>>>>> 
>>>>> you could use globalVariables() somewhere at the top-level in
>> your
>>>>> package:
>>>>> 
>>>>> utils::globalVariables("degree_C")
>>>>> 
>>>>> or you could supply degree_C as a literal character string:
>>>>> 
>>>>> set_units(T, "degree_C")
>>>>> 
>>>>> On Sat, Dec 10, 2022 at 11:13 PM EcoC2S - Irucka Embry
>>>>> <iembry using ecoccs.com> wrote:
>>>>>> 
>>>>>> In my iemisc package, I am using the units package.
>>>>>> 
>>>>>> This is an example of how I am using the set_units function:
>>>>>> 
>>>>>> T <- 20
>>>>>> 
>>>>>> set_units(T, degree_C)
>>>>>> 
>>>>>> Upon checking iemisc with devtools for CRAN submission, I
>> receive the
>>>>>> following note under "checking R code for possible problems":
>>>>>> 
>>>>>> no visible binding for global variable ‘degree_C’
>>>>>> 
>>>>>> Please tell me how to avoid that note in my R packages.
>>>>>> 
>>>>>> Thank you.
>>>>>> 
>>>>>> Irucka
>>>>>> 
>>>>>> --
>>>>>> --
>>>>>> No fear, Only Love! / ¡No temas, solamente amor!
>>>>>> -Irucka Ajani Embry, 15 March 2020
>>>>>> 
>>>>>> Family Partners:
>>>>>> http://www.sustainlex.org/
>>>>>> https://www.schoolingsolutions.com/
>>>>>> 
>>>>>> 
>> 
> ---------------------------------------------------------------------------------------------------------------
>>>>>> 
>>>>>> The business collaboration between EConsulting (tm)
>>>>>> [https://www.econsultingllc.org/] and EcoC^2S, is Getting Back
>> to
>>>>>> Nature.
>>>>>> 
>>>>>> Getting Back to Nature LocalHarvest --
>>>>>> https://www.localharvest.org/getting-back-to-nature-M73453
>>>>>> Getting Back to Nature -- https://www.gettingback2nature.farm/
>>>>>> 
>>>>>> -- Irucka and his twin brother, Obiora, are featured in the
>> Middle
>>>>>> Tennessee Local Table Magazine Annual issue. The article
>> discusses
>>>>>> their
>>>>>> family farm history and the current work that they are doing
>> under
>>>>>> Getting
>>>>>> Back to Nature. The full magazine can be found here [the
>> article
>>>>>> begins
>>>>>> on
>>>>>> page 18 of the PDF document]:
>>>>>> 
>>>>>> 
>> 
> https://media.gettingback2nature.farm/pdf/LocalTable_ANNUAL_2020_lo_res.pdf
>>>>>> 
>>>>>> -- Obiora and Irucka were interviewed separately in early 2020
>> for the
>>>>>> Natural Resources Defense Council's (NRDC) "Regenerative
>> Agriculture:
>>>>>> Farm
>>>>>> Policy for the 21st Century: Policy Recommendations to Advance
>>>>>> Regenerative
>>>>>> Agriculture" report written By Arohi Sharma, Lara Bryant, and
>> Ellen
>>>>>> Lee.
>>>>>> The PDF report is available below:
>>>>>> 
>>>>>> 
>> 
> https://www.nrdc.org/sites/default/files/regenerative-agriculture-farm-policy-21st-century-report.pdf
>>>>>> 
>>>>>> EcoC2S -- https://www.ecoccs.com/
>>>>>> Principal, Irucka Embry, EIT
>>>>>> 
>>>>>> Services:
>>>>>> Growing Food
>>>>>> Healthy Living Mentor
>>>>>> Data Analysis with R
>>>>>> R Training
>>>>>> Chemistry and Mathematics Tutoring
>>>>>> Free/Libre and Open Source Software (FLOSS) Consultation
>>>>>> 
>>>>>> ______________________________________________
>>>>>> R-package-devel using r-project.org mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>>> 
>>>> --
>>>> --
>>>> No fear, Only Love! / ¡No temas, solamente amor!
>>>> -Irucka Ajani Embry, 15 March 2020
>>>> 
>>>> Family Partners:
>>>> http://www.sustainlex.org/
>>>> https://www.schoolingsolutions.com/
>>>> 
>>>> 
>> 
> ---------------------------------------------------------------------------------------------------------------
>>>> 
>>>> The business collaboration between EConsulting (tm)
>>>> [https://www.econsultingllc.org/] and EcoC^2S, is Getting Back to
>>>> Nature.
>>>> 
>>>> Getting Back to Nature LocalHarvest --
>>>> https://www.localharvest.org/getting-back-to-nature-M73453
>>>> Getting Back to Nature -- https://www.gettingback2nature.farm/
>>>> 
>>>> -- Irucka and his twin brother, Obiora, are featured in the
>> Middle
>>>> Tennessee Local Table Magazine Annual issue. The article
>> discusses
>>>> their
>>>> family farm history and the current work that they are doing
>> under
>>>> Getting
>>>> Back to Nature. The full magazine can be found here [the article
>>>> begins
>>>> on
>>>> page 18 of the PDF document]:
>>>> 
>>>> 
>> 
> https://media.gettingback2nature.farm/pdf/LocalTable_ANNUAL_2020_lo_res.pdf
>>>> 
>>>> -- Obiora and Irucka were interviewed separately in early 2020
>> for the
>>>> Natural Resources Defense Council's (NRDC) "Regenerative
>> Agriculture:
>>>> Farm
>>>> Policy for the 21st Century: Policy Recommendations to Advance
>>>> Regenerative
>>>> Agriculture" report written By Arohi Sharma, Lara Bryant, and
>> Ellen
>>>> Lee.
>>>> The PDF report is available below:
>>>> 
>>>> 
>> 
> https://www.nrdc.org/sites/default/files/regenerative-agriculture-farm-policy-21st-century-report.pdf
>>>> 
>>>> EcoC2S -- https://www.ecoccs.com/
>>>> Principal, Irucka Embry, EIT
>>>> 
>>>> Services:
>>>> Growing Food
>>>> Healthy Living Mentor
>>>> Data Analysis with R
>>>> R Training
>>>> Chemistry and Mathematics Tutoring
>>>> Free/Libre and Open Source Software (FLOSS) Consultation
>>>> 
>>>> ______________________________________________
>>>> R-package-devel using r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>> 
>>> 
>>> 
>>> --
>>> Iñaki Úcar
>> 
>> --
>> --
>> No fear, Only Love! / ¡No temas, solamente amor!
>> -Irucka Ajani Embry, 15 March 2020
>> 
>> Family Partners:
>> http://www.sustainlex.org/
>> https://www.schoolingsolutions.com/
>> 
>> 
> ---------------------------------------------------------------------------------------------------------------
>> 
>> The business collaboration between EConsulting (tm)
>> [https://www.econsultingllc.org/] and EcoC^2S, is Getting Back to
>> Nature.
>> 
>> Getting Back to Nature LocalHarvest --
>> https://www.localharvest.org/getting-back-to-nature-M73453
>> Getting Back to Nature -- https://www.gettingback2nature.farm/
>> 
>> -- Irucka and his twin brother, Obiora, are featured in the Middle
>> Tennessee Local Table Magazine Annual issue. The article discusses
>> their
>> family farm history and the current work that they are doing under
>> Getting
>> Back to Nature. The full magazine can be found here [the article
>> begins
>> on
>> page 18 of the PDF document]:
>> 
>> 
> https://media.gettingback2nature.farm/pdf/LocalTable_ANNUAL_2020_lo_res.pdf
>> 
>> -- Obiora and Irucka were interviewed separately in early 2020 for
>> the
>> Natural Resources Defense Council's (NRDC) "Regenerative
>> Agriculture:
>> Farm
>> Policy for the 21st Century: Policy Recommendations to Advance
>> Regenerative
>> Agriculture" report written By Arohi Sharma, Lara Bryant, and Ellen
>> Lee.
>> The PDF report is available below:
>> 
>> 
> https://www.nrdc.org/sites/default/files/regenerative-agriculture-farm-policy-21st-century-report.pdf
>> 
>> EcoC2S -- https://www.ecoccs.com/
>> Principal, Irucka Embry, EIT
>> 
>> Services:
>> Growing Food
>> Healthy Living Mentor
>> Data Analysis with R
>> R Training
>> Chemistry and Mathematics Tutoring
>> Free/Libre and Open Source Software (FLOSS) Consultation
>> 
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> --
> 
> Alexandre Courtiol, www.datazoogang.de [1]
> 
> Links:
> ------
> [1] http://www.datazoogang.de

-- 
--
No fear, Only Love! / ¡No temas, solamente amor!
-Irucka Ajani Embry, 15 March 2020

Family Partners:
http://www.sustainlex.org/
https://www.schoolingsolutions.com/

---------------------------------------------------------------------------------------------------------------

The business collaboration between EConsulting (tm)
[https://www.econsultingllc.org/] and EcoC^2S, is Getting Back to 
Nature.

Getting Back to Nature LocalHarvest --
https://www.localharvest.org/getting-back-to-nature-M73453
Getting Back to Nature -- https://www.gettingback2nature.farm/

-- Irucka and his twin brother, Obiora, are featured in the Middle
Tennessee Local Table Magazine Annual issue. The article discusses their
family farm history and the current work that they are doing under 
Getting
Back to Nature. The full magazine can be found here [the article begins 
on
page 18 of the PDF document]:

https://media.gettingback2nature.farm/pdf/LocalTable_ANNUAL_2020_lo_res.pdf

-- Obiora and Irucka were interviewed separately in early 2020 for the
Natural Resources Defense Council's (NRDC) "Regenerative Agriculture: 
Farm
Policy for the 21st Century: Policy Recommendations to Advance 
Regenerative
Agriculture" report written By Arohi Sharma, Lara Bryant, and Ellen Lee.
The PDF report is available below:

https://www.nrdc.org/sites/default/files/regenerative-agriculture-farm-policy-21st-century-report.pdf

EcoC2S -- https://www.ecoccs.com/
Principal, Irucka Embry, EIT

Services:
Growing Food
Healthy Living Mentor
Data Analysis with R
R Training
Chemistry and Mathematics Tutoring
Free/Libre and Open Source Software (FLOSS) Consultation



More information about the R-package-devel mailing list