[R-pkg-devel] Error uploading file on CRAN

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Mon Dec 5 09:01:00 CET 2022


On Mon, 5 Dec 2022 11:14:19 +0400
"Jahajeeah, Havisha" <hjahajeeah using utm.ac.mu> wrote:

> Will a binary package resolve the above issue?

Due to an interaction between the way R binary packages work and the
way you have implemented the Greymodels:::ui variable, this binary
package will only work on your computer. (And, well, on other computers
where the library path is the same.) A better workaround would be to
ask your users to install the source package instead of installing the
binary package when one is available for their platform.

The code that creates the `ui` variable in your package is evaluated
when the binary package is built by CRAN (or you). The resulting object
contains file paths that are only valid on CRAN computers (or your
computer). You need that code to run on users' computers after the
package is installed, not on CRAN computers (or your computer) when
it's built. In order to achieve that, you need to change the definition
of the `ui` variable into a function. The function doesn't even have to
take arguments; you can just prepend function() to the right-hand side
of the assignment. Inside the `run_app` function, call that function
instead of referring to that variable. This will make sure that the
temporary object created by `ui()` contains the file paths from the
user's computer.

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list