Re: [R-pkg-devel] warning: explicit assigning values of variable of type ....

2024-06-06 Thread Iris Simmons
Unless I'm misunderstanding, you're trying to pass a value by name to a function. That is not a thing in C nor C++. However if you want to name the arguments, you can do so with comments: /* print = */ print On Thu, Jun 6, 2024, 19:16 Søren Højsgaard via R-package-devel <

Re: [R-pkg-devel] Including "Rmath.h" in C code for an R package

2024-06-02 Thread Iris Simmons
To avoid the remapping of beta to Rf_beta, you should define R_NO_REMAP_RMATH before you include Rmath: #define R_NO_REMAP_RMATH #include On Sun, Jun 2, 2024, 19:33 Gregory Raskind wrote: > Hi, > > I'm extending an R package that uses the R C API directly. I'd like to use > some distribution

Re: [R-pkg-devel] Assigning an object to the global environment (shiny package)

2024-01-04 Thread Iris Simmons
You cannot and should not ignore this. An R package should never ever be assigning variables into environments for which they haven't been granted permission to do so. You should ask the user whether they want the object assigned in the global environment before doing so, and the default should

Re: [R-pkg-devel] Question regarding finding the source file location without R-packages outside of R-Studio

2023-11-23 Thread Iris Simmons
I think 'package:renv' does a lot of the stuff you mentioned here. I think they accomplished your issue by making an .Rprofile file for each project. The working directory would be set to the root directory of the project, the R profile runs and sets .libPaths() as appropriate, then the scripts

Re: [R-pkg-devel] Check warning around sprintf: Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor use Fortran I/O nor system

2023-11-20 Thread Iris Simmons
The n in snprintf includes the room for the terminating nul. It should be 8191. If gcc is throwing a warning, it can be ignored. On Mon, Nov 20, 2023, 04:04 Serguei Sokol wrote: > Le 19/11/2023 à 02:07, Iris Simmons a écrit : > > Yes, the reason for the error is the use of sprintf

Re: [R-pkg-devel] Check warning around sprintf: Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor use Fortran I/O nor system

2023-11-18 Thread Iris Simmons
Yes, the reason for the error is the use of sprintf. You can instead use snprintf where n is the maximum number of bytes to write, including the terminating nul character. For example: char msg[8191]; snprintf(msg, 8191, "criteria: error (%d) -> %s\n", inErr, errStr); Rf_error(msg); or however

Re: [R-pkg-devel] CartogRaflow submission

2023-10-17 Thread Iris Simmons
The packages that you imported are no longer available. As far as I understand, rgeos, maptools, and a few other spatial related packages have been archived and have been replaced with better alternatives. On Tue, Oct 17, 2023, 03:13 cartograf...@gmail.com wrote: > Hi, I've put an update

Re: [R-pkg-devel] Problem with "additional repository".

2023-10-15 Thread Iris Simmons
The packages in additional repositories are not installed on the CRAN checking machines. The NOTE is expected, but it's not a warning, so your package should still be allowed to upload to CRAN. You should not remove ionChannelData from Suggests because then the reference to that package in your

Re: [R-pkg-devel] Error: [writeRaster] cannot write file

2023-10-09 Thread Iris Simmons
You wrote # create the plots directory if it does not exist but then created a directory named outdir/plots/typ_Sys.time.tif You need to rewrite the code like: plotsdir <- file.path(outdir, "plots") fp <- file.path(plotsdir, paste(typ, "_", stringr::str_replace_all(Sys.time(),

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-05 Thread Iris Simmons
You can add \keyword{internal} to the Rd file. Your documentation won't show up the in the pdf manual, it won't show up in the package index, but you'll still be able to access the doc page with ?levels.no or help("levels.no"). This is usually used in a package's deprecated and defunct doc

Re: [R-pkg-devel] (no subject)

2023-04-18 Thread Iris Simmons
You put a space between "https:" and "//", you should definitely remove that. Also, you need to indent your description. Right now, your DESCRIPTION is being interpreted in this manner: ``` Package "neotoma2" Title