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
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(), "[^a-zA-Z0-9
://builder.r-hub.io/status/geohabnet_1.0.0.tar.gz-a2eaa40ccf1d026bbebf5077bfb482d5>
Best Regards,
Krishna Keshav
*From: *Duncan Murdoch
*Date: *Monday, October 9, 2023 at 4:08 PM
*To: *Keshav, Krishna , r-package-devel@r-project.org
*Subject: *Re: [R-pkg-devel] Error: [writeRaster] cannot write
tps://builder.r-hub.io/status/geohabnet_1.0.0.tar.gz-a2eaa40ccf1d026bbebf5077bfb482d5
Best Regards,
Krishna Keshav
From: Duncan Murdoch
Date: Monday, October 9, 2023 at 4:08 PM
To: Keshav, Krishna , r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Error: [writeRaster] cannot write f
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
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 h