diff --git a/R/tar-terra-rast.R b/R/tar-terra-rast.R index 58b170d..f54442a 100644 --- a/R/tar-terra-rast.R +++ b/R/tar-terra-rast.R @@ -3,14 +3,17 @@ #' Provides a target format for [terra::SpatRaster-class] objects. #' #' @details -#' [terra::SpatRaster-class] objects do not contain raster data directly—they -#' contain a C++ pointer to memory where the data is stored. As a result, these -#' objects are not portable between R sessions without special handling, which -#' causes problems when including them in `targets` pipelines with -#' `tar_target()`. `tar_terra_rast()` handles this issue by writing and reading -#' the target as a geospatial file (specified by `filetype`) rather than saving -#' the `SpatRaster` object itself. -#' +#' The terra package uses objects like [terra::SpatRaster-class], +#' [terra::SpatVector-class], and [terra::SpatRasterDataset] (SDS), which do +#' not contain the data directly--they contain a C++ pointer to memory where +#' the data is stored. As a result, these objects are not portable between +#' R sessions without special handling, which causes problems when including +#' them in `targets` pipelines with [targets::tar_target()]. The functions, +#' [tar_terra_rast()], [tar_terra_sds()], [tar_terra_sprc()], +#' [tar_terra_tiles()], and [tar_terra_vect()] handle this issue by writing and +#' reading the target as a geospatial file (specified by `filetype`) rather +#' than saving the relevant object (e.g., `SpatRaster`, `SpatVector`, etc.), +#' itself. #' #' @param name Symbol, name of the target. A target name must be a valid name #' for a symbol in R, and it must not start with a dot. See diff --git a/R/tar-terra-sprc.R b/R/tar-terra-sprc.R index c29e8ab..986cb91 100644 --- a/R/tar-terra-sprc.R +++ b/R/tar-terra-sprc.R @@ -3,6 +3,8 @@ #' Provides a target format for [terra::SpatRasterCollection] objects, #' which have no restriction in the extent or other geometric parameters. #' +#' @inherit tar_terra_rast details +#' #' @param name Symbol, name of the target. A target name must be a valid name #' for a symbol in R, and it must not start with a dot. See #' [targets::tar_target()] for more information. @@ -129,6 +131,8 @@ tar_terra_sprc <- function( #' Provides a target format for [terra::SpatRasterDataset] objects, #' which hold sub-datasets, each a `SpatRaster` that can have multiple layers. #' +#' @inherit tar_terra_rast details +#' #' @param name Symbol, name of the target. A target name must be a valid name #' for a symbol in R, and it must not start with a dot. See #' [targets::tar_target()] for more information. diff --git a/R/tar-terra-vect.R b/R/tar-terra-vect.R index ee220ed..d6b7888 100644 --- a/R/tar-terra-vect.R +++ b/R/tar-terra-vect.R @@ -2,14 +2,7 @@ #' #' Provides a target format for [terra::SpatVector-class] objects. #' -#' @details -#' [terra::SpatVector-class] objects do not contain vector data directly—they -#' contain a C++ pointer to memory where the data is stored. As a result, these -#' objects are not portable between R sessions without special handling, which -#' causes problems when including them in `targets` pipelines with -#' `tar_target()`. `tar_terra_rast()` handles this issue by writing and reading -#' the target as a geospatial file (specified by `filetype`) rather than saving -#' the `SpatVector` object itself. +#' @inherit tar_terra_rast details #' #' @param name Symbol, name of the target. A target name must be a valid name #' for a symbol in R, and it must not start with a dot. See diff --git a/man/tar_terra_rast.Rd b/man/tar_terra_rast.Rd index a017fd8..b7ef1ec 100644 --- a/man/tar_terra_rast.Rd +++ b/man/tar_terra_rast.Rd @@ -232,13 +232,17 @@ target class "tar_stem" for use in a target pipeline Provides a target format for \link[terra:SpatRaster-class]{terra::SpatRaster} objects. } \details{ -\link[terra:SpatRaster-class]{terra::SpatRaster} objects do not contain raster data directly—they -contain a C++ pointer to memory where the data is stored. As a result, these -objects are not portable between R sessions without special handling, which -causes problems when including them in \code{targets} pipelines with -\code{tar_target()}. \code{tar_terra_rast()} handles this issue by writing and reading -the target as a geospatial file (specified by \code{filetype}) rather than saving -the \code{SpatRaster} object itself. +The terra package uses objects like \link[terra:SpatRaster-class]{terra::SpatRaster}, +\link[terra:SpatVector-class]{terra::SpatVector}, and \link[terra:SpatRaster-class]{terra::SpatRasterDataset} (SDS), which do +not contain the data directly--they contain a C++ pointer to memory where +the data is stored. As a result, these objects are not portable between +R sessions without special handling, which causes problems when including +them in \code{targets} pipelines with \code{\link[targets:tar_target]{targets::tar_target()}}. The functions, +\code{\link[=tar_terra_rast]{tar_terra_rast()}}, \code{\link[=tar_terra_sds]{tar_terra_sds()}}, \code{\link[=tar_terra_sprc]{tar_terra_sprc()}}, +\code{\link[=tar_terra_tiles]{tar_terra_tiles()}}, and \code{\link[=tar_terra_vect]{tar_terra_vect()}} handle this issue by writing and +reading the target as a geospatial file (specified by \code{filetype}) rather +than saving the relevant object (e.g., \code{SpatRaster}, \code{SpatVector}, etc.), +itself. } \note{ The \code{iteration} argument is unavailable because it is hard-coded to diff --git a/man/tar_terra_sds.Rd b/man/tar_terra_sds.Rd index a28e75e..d7e6d22 100644 --- a/man/tar_terra_sds.Rd +++ b/man/tar_terra_sds.Rd @@ -217,6 +217,19 @@ target class "tar_stem" for use in a target pipeline Provides a target format for \link[terra:SpatRaster-class]{terra::SpatRasterDataset} objects, which hold sub-datasets, each a \code{SpatRaster} that can have multiple layers. } +\details{ +The terra package uses objects like \link[terra:SpatRaster-class]{terra::SpatRaster}, +\link[terra:SpatVector-class]{terra::SpatVector}, and \link[terra:SpatRaster-class]{terra::SpatRasterDataset} (SDS), which do +not contain the data directly--they contain a C++ pointer to memory where +the data is stored. As a result, these objects are not portable between +R sessions without special handling, which causes problems when including +them in \code{targets} pipelines with \code{\link[targets:tar_target]{targets::tar_target()}}. The functions, +\code{\link[=tar_terra_rast]{tar_terra_rast()}}, \code{\link[=tar_terra_sds]{tar_terra_sds()}}, \code{\link[=tar_terra_sprc]{tar_terra_sprc()}}, +\code{\link[=tar_terra_tiles]{tar_terra_tiles()}}, and \code{\link[=tar_terra_vect]{tar_terra_vect()}} handle this issue by writing and +reading the target as a geospatial file (specified by \code{filetype}) rather +than saving the relevant object (e.g., \code{SpatRaster}, \code{SpatVector}, etc.), +itself. +} \note{ The \code{iteration} argument is unavailable because it is hard-coded to \code{"list"}, the only option that works currently. diff --git a/man/tar_terra_sprc.Rd b/man/tar_terra_sprc.Rd index 7bcc9f6..46668bd 100644 --- a/man/tar_terra_sprc.Rd +++ b/man/tar_terra_sprc.Rd @@ -217,6 +217,19 @@ target class "tar_stem" for use in a target pipeline Provides a target format for \link[terra:SpatRaster-class]{terra::SpatRasterCollection} objects, which have no restriction in the extent or other geometric parameters. } +\details{ +The terra package uses objects like \link[terra:SpatRaster-class]{terra::SpatRaster}, +\link[terra:SpatVector-class]{terra::SpatVector}, and \link[terra:SpatRaster-class]{terra::SpatRasterDataset} (SDS), which do +not contain the data directly--they contain a C++ pointer to memory where +the data is stored. As a result, these objects are not portable between +R sessions without special handling, which causes problems when including +them in \code{targets} pipelines with \code{\link[targets:tar_target]{targets::tar_target()}}. The functions, +\code{\link[=tar_terra_rast]{tar_terra_rast()}}, \code{\link[=tar_terra_sds]{tar_terra_sds()}}, \code{\link[=tar_terra_sprc]{tar_terra_sprc()}}, +\code{\link[=tar_terra_tiles]{tar_terra_tiles()}}, and \code{\link[=tar_terra_vect]{tar_terra_vect()}} handle this issue by writing and +reading the target as a geospatial file (specified by \code{filetype}) rather +than saving the relevant object (e.g., \code{SpatRaster}, \code{SpatVector}, etc.), +itself. +} \note{ The \code{iteration} argument is unavailable because it is hard-coded to \code{"list"}, the only option that works currently. diff --git a/man/tar_terra_vect.Rd b/man/tar_terra_vect.Rd index 08ca86f..0b3a19b 100644 --- a/man/tar_terra_vect.Rd +++ b/man/tar_terra_vect.Rd @@ -217,13 +217,17 @@ target class "tar_stem" for use in a target pipeline Provides a target format for \link[terra:SpatVector-class]{terra::SpatVector} objects. } \details{ -\link[terra:SpatVector-class]{terra::SpatVector} objects do not contain vector data directly—they -contain a C++ pointer to memory where the data is stored. As a result, these -objects are not portable between R sessions without special handling, which -causes problems when including them in \code{targets} pipelines with -\code{tar_target()}. \code{tar_terra_rast()} handles this issue by writing and reading -the target as a geospatial file (specified by \code{filetype}) rather than saving -the \code{SpatVector} object itself. +The terra package uses objects like \link[terra:SpatRaster-class]{terra::SpatRaster}, +\link[terra:SpatVector-class]{terra::SpatVector}, and \link[terra:SpatRaster-class]{terra::SpatRasterDataset} (SDS), which do +not contain the data directly--they contain a C++ pointer to memory where +the data is stored. As a result, these objects are not portable between +R sessions without special handling, which causes problems when including +them in \code{targets} pipelines with \code{\link[targets:tar_target]{targets::tar_target()}}. The functions, +\code{\link[=tar_terra_rast]{tar_terra_rast()}}, \code{\link[=tar_terra_sds]{tar_terra_sds()}}, \code{\link[=tar_terra_sprc]{tar_terra_sprc()}}, +\code{\link[=tar_terra_tiles]{tar_terra_tiles()}}, and \code{\link[=tar_terra_vect]{tar_terra_vect()}} handle this issue by writing and +reading the target as a geospatial file (specified by \code{filetype}) rather +than saving the relevant object (e.g., \code{SpatRaster}, \code{SpatVector}, etc.), +itself. } \note{ The \code{iteration} argument is unavailable because it is hard-coded to