[R-pkg-devel] [EXTERNAL] Usage of internet resources in examples

Hong Ooi hongoo| @end|ng |rom m|cro@o|t@com
Tue Oct 20 23:42:30 CEST 2020


I set \dontrun{} on (most of) the examples in my Azure-related packages, for this very reason. They assume the user has an Azure subscription, and in any case, you don't want to be running code that could potentially cost lots of money just for kicks. The packages in question are basically all those on CRAN that start with "Azure".

I cleared this with Uwe Ligges some time back; although whenever I submit a new package, I tend to get emails from whoever did the review that \donttest() should be removed. I've been able to resolve this by replying and cc'ing Uwe, mentioning that it was approved previously.


-----Original Message-----
From: R-package-devel <r-package-devel-bounces using r-project.org> On Behalf Of Andy Teucher
Sent: Wednesday, 21 October 2020 7:29 AM
To: r-package-devel using r-project.org
Subject: [EXTERNAL] [R-pkg-devel] Usage of internet resources in examples

Our package bcdata (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.r-project.org%2Fpackage%3Dbcdata&data=04%7C01%7Chongooi%40microsoft.com%7C3a5d0a6f36074ebfde8408d87536d145%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637388226515752313%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=xxnnjkhi%2B40WOm6S9VBrAB8M4IPePX0MrvN3oosqYnA%3D&reserved=0) retrieves public data from British Columbia data services, so the examples are dependent on successfully hitting web resources. When we initially submitted to CRAN the examples were wrapped in \dontrun{}, but we were asked to change them to use \donttest{}.

 
Now, CRAN is running checks with _R_CHECK_DONTTEST_EXAMPLES_=true, and one of the examples has failed due to a changed web resource. I got an email asking me to fix it and reminding me of the CRAN policy:
 

  'Packages which use Internet resources should fail gracefully with an informative message

 if the resource is not available or has changed (and not give a check warning nor error).'

  This needs correction whether or not the resource recovers.

 
I would prefer that in normal use, the function calling the internet resources fails with an error so that the user is properly alerted. I also agree that these failures shouldn't cause a check error. To demonstrate the use of these functions in examples, is there a preferred method of ensuring that failures will not cause a check warning or error? Should I try to revert back to using \dontrun{} and plead my case? Wrap in `if interactive())`?
 

Thanks very much,

Andy Teucher

 
______________________________________________
R-package-devel using r-project.org mailing list
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=04%7C01%7Chongooi%40microsoft.com%7C3a5d0a6f36074ebfde8408d87536d145%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637388226515752313%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qzv9k50S770BrVY%2BAAsDE8i0w8C3zW3reZtxZOJdW9E%3D&reserved=0



More information about the R-package-devel mailing list