diff --git a/R/CST_Start.R b/R/CST_Start.R index 4b78ee0c979e61a70384ef8ff45c61c829cb7644..12c1de5393c0ceafdca1b90641aa055f2791fdb1 100644 --- a/R/CST_Start.R +++ b/R/CST_Start.R @@ -13,6 +13,11 @@ #'auxiliary startR functions (e.g. indices(), values(), Sort(), CircularSort(), #'CDORemapper(), ...) can be used to define dimensions. #' +#'CST_Start() uses as.s2dv_cube() to transform the output into an s2dv_cube +#'object. The as.s2dv_cube() function is designed to be used with data that +#'has been retrieved into memory. To avoid errors, please ensure that +#'CST_Start(..., retrieve = TRUE) is specified. +#' #'@param ... Parameters that are automatically forwarded to the `startR::Start` #' function. See details in `?startR::Start`. #'@examples @@ -33,7 +38,7 @@ #' latitude = c('lat', 'latitude')), #' return_vars = list(time = 'sdate', #' longitude = NULL, latitude = NULL), -#' retrieve = FALSE) +#' retrieve = TRUE) #'} #'\dontshow{ #' exp <- CSTools::lonlat_temp_st$exp diff --git a/R/as.s2dv_cube.R b/R/as.s2dv_cube.R index f81766ecdf376b340094ab19ceeaa2fa54b2cb5c..c504fbcc69ed170e96be0c510830d163712986ff 100644 --- a/R/as.s2dv_cube.R +++ b/R/as.s2dv_cube.R @@ -350,9 +350,14 @@ as.s2dv_cube <- function(object, remove_attrs_coords = FALSE, ## load_parameters result$attrs$load_parameters <- attributes(object)$FileSelectors class(result) <- 's2dv_cube' + } else if (inherits(object, 'startR_cube')) { + stop("Unsupported object class: 'startR_cube'. ", + "When using startR::Start() or CSTools::CST_Start(), set ", + "'retrieve = TRUE' to ensure the data is retrieved into ", + "memory and can be converted into a 's2dv_cube' object.") } else { stop("The class of parameter 'object' is not implemented", " to be converted into 's2dv_cube' class yet.") } return(result) -} \ No newline at end of file +}