[R-pkg-devel] correcting errors in an existing package

Kevin R. Coombes kev|n@r@coombe@ @end|ng |rom gm@||@com
Sat Apr 1 23:03:28 CEST 2023


1. Yes, remove the "lazyData" line from the DESCRIPTION file.

2. Do you have "stats" in the "Imports" line in the DESCRIPTION file? If 
not, put it in along with the "importFrom" line in the NAMESPACE file.

On 3/31/2023 4:51 PM, Dennis Boos wrote:
> Recently I got a message from CRAN that my package Monte.Carlo.se (on CRAN
> for the last few years) does not pass current testing.  There seemed to be
> 2 problems:
>
> ***************************************************************************************************************
>
> 1. * checking LazyData ... NOTE
>    'LazyData' is specified without a 'data' directory
>
> I have this line in my DESCRIPTION file:
>
> LazyData: true
>
> Should I remove that?
>
> *****************************************************************************************************************
>
> 2. * checking examples with --run-donttest ... [42s/42s] ERROR
> Running examples in ‘Monte.Carlo.se-Ex.R’ failed
> The error most likely occurred in:
>
>> pairwise.se(hold,xcol=10:12,summary.f=cv)
> Error: object 'hold' not found
> Execution halted
>
> ***************************************************************************************
>
> So, I put in the R code to generate the data matrix *hold.  *But that
> brought a host of other errors when checking in Rstudio with
>
>> devtools::check("S:/Documents/srcis/a.projects/Monte.Carlo.isr.and.package/Monte.Carlo.se.March.2023")
> I started seeing the following list about standard functions like sd.
>
> N  checking R code for possible problems (3.4s)
>     boot.se: no visible global function definition for 'sd'
>     boot.var: no visible global function definition for 'var'
>     corr: no visible global function definition for 'cor'
>     cv: no visible global function definition for 'sd'
>     ratio.mean.sdhat.sd: no visible global function definition for 'sd'
>     ratio.mean.vhat.var: no visible global function definition for 'var'
>     ratio.sd: no visible global function definition for 'sd'
>     ratio.var: no visible global function definition for 'var'
>     varn: no visible global function definition for 'var'
>     Undefined global functions or variables:
>       cor sd var
>     Consider adding
>       importFrom("stats", "cor", "sd", "var")
>     to your NAMESPACE file.
>
> But you can't add those functions to NAMESPACE. Well I did but
>
> devtools::build()
>
>
> gets rid of it. Also, I keep getting the message in the Rstudio check
>
> WARNING
>     'qpdf' is needed for checks on size reduction of PDFs
>
>
> but I got the latest versions of R and Rstudio and was able to get
> qpdf to install and loaded with library(qpdf), but Rstudio still gives
> that message.
>
> So, if anybody has any suggestions, I would appreciate it.
>
> Thanks.
>
> Dennis
>
>
>
>
>
>
>
>
>
>



More information about the R-package-devel mailing list