-
Help
DescriptionHi folks, I want to have a target that gets data using the
This package requires that you specify a directory to save the data to, but at the time of writing I am not 100% sure what the file names will be. I was wondering what the best practice is to be able to:
Let me know if I can make this clearer or provide more information! Cheers, Nick |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since it looks like format_geotiff <- tar_format(
read = function(path) terra::rast(path),
write = function(object, path) terra::writeRaster(x = object, filename = path, filetype = "GTiff", overwrite = TRUE),
marshal = function(object) terra::wrap(object),
unmarshal = function(object) terra::unwrap(object)
)
list(
tar_target(coffee_data, crop_coffee_data(), format = format_geotiff)
) The other option is to write the results out explicitly as part of your |
Beta Was this translation helpful? Give feedback.
Since it looks like
crop_spam()
returns a SpatRaster object, the discussion here might be useful. In particular, I've been using the following for theformat
argument for targets that return SpatRasters with success.The other option is to write the results out explicitly as part of your
crop_coffee_data()
function (e.g…