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

2023-10-09 Thread Keshav, Krishna
Hi, This works. I think this is also an implementation of what Berry and Duncan suggested earlier. Thanks. Best Regards, Krishna Keshav From: Iris Simmons Date: Monday, October 9, 2023 at 7:37 PM To: Keshav, Krishna Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] Error:

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] Error: [writeRaster] cannot write file

2023-10-09 Thread Duncan Murdoch
On 09/10/2023 6:56 p.m., Keshav, Krishna wrote: Outdir is either a directory like getwd(), tempdir() etc or empty/null. If it is empty/null, then I set it to tempdir(). That doesn't answer the question, and the link you provided doesn't answer it either, as far as I can see. In the test and

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

2023-10-09 Thread Keshav, Krishna
Outdir is either a directory like getwd(), tempdir() etc or empty/null. If it is empty/null, then I set it to tempdir(). if (is.null(outdir) || length(outdir) == 0) { outdir <- tempdir() } I am not sure how to debug when running it in Rbuilder. But you can look at results here -

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

2023-10-09 Thread Berry Boessenkool
Are you intentionally running dir.exists on _file_names? dir.exists("existing_folder/imaginary.file") shows FALSE, somwhat counterintuitively. You might want to wrap the filenames in dirname... Regards, Berry From: R-package-devel on behalf of Keshav, Krishna

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

2023-10-09 Thread Duncan Murdoch
What were you using as "outdir"? On 09/10/2023 2:59 p.m., Keshav, Krishna wrote: Hi, I am developing an R package where I need to save Raster file with .tif extension to the tempdir(). I am using terra::writeRaster for the same. While it works through R CMD check in mac, it is failing in R

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

2023-10-09 Thread Keshav, Krishna
Hi, I am developing an R package where I need to save Raster file with .tif extension to the tempdir(). I am using terra::writeRaster for the same. While it works through R CMD check in mac, it is failing in R hub builder. Snippet �V .saverast <- function(typ, rast, outdir) { if

Re: [R-pkg-devel] Problem persists, was Re: Problem compressing vignettes for CRAN

2023-10-09 Thread Jeff Newmiller via R-package-devel
R could care less about what is in PATH... there is however a difference between Windows parsing PATH and how CMD lets you quote things interactively. The whole point of PATH is to let you or R provide simple program names like qpdf without knowing where they are... Windows takes over and looks

Re: [R-pkg-devel] Problem persists, was Re: Problem compressing vignettes for CRAN

2023-10-09 Thread Michael Dewey
Dear Ivan (and list) Using Ivan's advice I traced the problem to a difference of opinio between Microsoft and R about paht names. I had mistakenly enclosed parts of the names in "" which was fine for MS but not R. Sys.which() was my saviour here. Many thanks to Ivan for broadening my

Re: [R-pkg-devel] Note: no function found corresponding to methods exports for show

2023-10-09 Thread Mikael Jagan
On 2023-10-08 5:43 pm, Mikael Jagan wrote: Hi, I recently submitted my first R package to CRAN, and I encountered a NOTE during the checking process. The NOTE looks like this: = Flavor: r-devel-linux-x86_64-debian-gcc,

Re: [R-pkg-devel] Problem persists, was Re: Problem compressing vignettes for CRAN

2023-10-09 Thread Ivan Krylov
On Sun, 8 Oct 2023 16:47:41 +0100 Michael Dewey wrote: > Following on from Ivan's advice I have now installed qpdf and > Ghostview. I have checked that they are both on my path by typing > their name at the command line and verifying they open. > I then built the package with the

Re: [R-pkg-devel] CXX_VISIBILITY on macOS

2023-10-09 Thread Matthias Gondan
You found the problem, thanks! Matthias, this has nothing to do with R, but rather your code. You have the wrong order of headers: the SWI headers mess up visibility macros, so you have to include them *after* Rcpp.h. Cheers, Simon [[alternative HTML version deleted]]