diff --git a/R/datacube.R b/R/datacube.R index c43c35c..068c39b 100644 --- a/R/datacube.R +++ b/R/datacube.R @@ -14,8 +14,8 @@ #' tidyopeneo and you want to come back to use tidyopeneo functions. #' @export datacube=function(id, data = NULL, - .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud")){ + .p = openeo::processes(.con), + .con = NULL){ if (is.null(id) & !is.null(data)){ class(data) = c("datacube", class(data)) # Class definition diff --git a/R/filter.R b/R/filter.R index f098971..486014b 100644 --- a/R/filter.R +++ b/R/filter.R @@ -38,6 +38,7 @@ #' library(tidyopeneo) #' library(sf) #' +#' con = connect(host = "https://openeo.cloud") #' dc = datacube(id = "SENTINEL_5P_L2") #' #' # filter_temporal and filter_bbox @@ -64,7 +65,7 @@ filter.datacube <- function(.data = NULL, ..., .condition = NULL, .dimension = NULL, .context = NULL, .extent = NULL, .geometries = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/R/group_by.R b/R/group_by.R index 3d4d4be..d6029ef 100644 --- a/R/group_by.R +++ b/R/group_by.R @@ -83,7 +83,7 @@ #' @examples #' library(tidyopeneo) #' library(sf) -#' +#' con = connect(host = "https://openeo.cloud") #' # bounding box #' w = 6.09 #' s = 46.15 @@ -130,7 +130,7 @@ group_by.datacube <- function(.data = NULL, ..., .period = NULL, .reducer = NULL .dimension = NULL, .context = NULL, .geometries = NULL, .target_dimension = "result", .intervals = NULL, .labels = array(), - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/R/mutate.R b/R/mutate.R index 498bc99..ddc4d0a 100644 --- a/R/mutate.R +++ b/R/mutate.R @@ -72,7 +72,7 @@ #' @importFrom dplyr mutate #' @examples #' library(tidyopeneo) -#' +#' con = connect(host = "https://openeo.cloud") #' dc = datacube(id = "SENTINEL_5P_L2") #' #' # apply @@ -114,7 +114,7 @@ mutate.datacube <- function(.data = NULL, ..., .kernel = NULL, .factor = 1, .border = 0, .replace_invalid = 0, .dimension = NULL, .target_dimension = NULL, .size = NULL, .overlap = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/R/rename.R b/R/rename.R index b833272..94170f5 100644 --- a/R/rename.R +++ b/R/rename.R @@ -17,6 +17,7 @@ #' @importFrom dplyr rename #' @examples #' library(tidyopeneo) +#' con = connect(host = "https://openeo.cloud") #' #' # bounding box #' w = 6.09 @@ -35,7 +36,7 @@ #' rename(.source = "spatial", .target = "space") #' @export rename.datacube <- function(.data = NULL, ..., .source, .target, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/R/resample.R b/R/resample.R index 697acb8..02ce3fe 100644 --- a/R/resample.R +++ b/R/resample.R @@ -63,6 +63,7 @@ #' @import dplyr openeo cli #' @examples #' library(tidyopeneo) +#' con = connect(host = "https://openeo.cloud") #' #' # bounding box #' w = 6.09 @@ -84,7 +85,7 @@ resample <- function(.data = NULL, .resolution = 0, .projection = NULL, .method = "near", .align = "upper-left", .target = NULL, .dimension = NULL, .valid_within = NULL, .target_process = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { UseMethod("resample") } @@ -94,7 +95,7 @@ resample.datacube <- function(.data = NULL, .resolution = 0, .projection = NULL, .method = "near", .align = "upper-left", .target = NULL, .dimension = NULL, .valid_within = NULL, .target_process = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { # check mandatory argument if (is.null(.data)) { diff --git a/R/select.R b/R/select.R index 5107978..42b6c89 100644 --- a/R/select.R +++ b/R/select.R @@ -26,13 +26,14 @@ #' @importFrom dplyr select #' @examples #' library(tidyopeneo) +#' con = connect(host = "https://openeo.cloud") #' dc = datacube(id = "SENTINEL_5P_L2") #' #' dc_no2 <- dc %>% select(.bands = "NO2") #' @export select.datacube <- function(.data = NULL, ..., .bands = NULL, .wavelength = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... diff --git a/R/slice.R b/R/slice.R index f1f9a43..db210d1 100644 --- a/R/slice.R +++ b/R/slice.R @@ -30,6 +30,7 @@ #' @importFrom methods as #' @examples #' library(tidyopeneo) +#' con = connect(host = "https://openeo.cloud") #' #' dc = datacube("TERRASCOPE_S5P_L3_NO2_TD_V1") #' @@ -45,7 +46,7 @@ #' @export slice.datacube <- function(.data = NULL, ..., n = 1, prop = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")){ + .p = openeo::processes(.con), .con = NULL){ #check dots ... dots = list(...) diff --git a/R/summarise.R b/R/summarise.R index 9344110..9d2f0c0 100644 --- a/R/summarise.R +++ b/R/summarise.R @@ -20,7 +20,7 @@ #' @seealso [openeo::list_processes()] #' @examples #' library(tidyopeneo) -#' +#' con = connect(host = "https://openeo.cloud") #' # bounding box #' w = 6.09 #' s = 46.15 @@ -39,7 +39,7 @@ #' @export summarise.datacube <- function(.data = NULL, ..., .reducer = NULL, .dimension = NULL, .context = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/R/summarize.R b/R/summarize.R index 53853cf..c1edc34 100644 --- a/R/summarize.R +++ b/R/summarize.R @@ -20,6 +20,7 @@ #' @seealso [openeo::list_processes()] #' @examples #' library(tidyopeneo) +#' con = connect(host = "https://openeo.cloud") #' #' # bounding box #' w = 6.09 @@ -39,7 +40,7 @@ #' @export summarize.datacube <- function(.data = NULL, ..., .reducer = NULL, .dimension = NULL, .context = NULL, - .p = openeo::processes(.con), .con = openeo::connect("https://openeo.cloud")) { + .p = openeo::processes(.con), .con = NULL) { #check dots ... dots = list(...) diff --git a/README.md b/README.md index 85b3aae..7b66b59 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ ## Example with NDVI -![NDVI Example](fig/ndvi-example.jpeg) +![NDVI Example](doc/ndvi-example.jpeg) diff --git a/fig/ndvi-example.jpeg b/fig/ndvi-example.jpeg deleted file mode 100644 index f758bc1..0000000 Binary files a/fig/ndvi-example.jpeg and /dev/null differ diff --git a/man/datacube.Rd b/man/datacube.Rd index a72e127..f57b173 100644 --- a/man/datacube.Rd +++ b/man/datacube.Rd @@ -4,12 +4,7 @@ \alias{datacube} \title{Create Datacube Class} \usage{ -datacube( - id, - data = NULL, - .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") -) +datacube(id, data = NULL, .p = openeo::processes(.con), .con = NULL) } \arguments{ \item{id}{character containing the collection name to be passed to diff --git a/man/filter.Rd b/man/filter.Rd index d73365d..9fd0dc9 100644 --- a/man/filter.Rd +++ b/man/filter.Rd @@ -14,7 +14,7 @@ .extent = NULL, .geometries = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -64,6 +64,7 @@ filter_spatial and array_filter functions into a simulated dplyr's \code{\link[d library(tidyopeneo) library(sf) +con = connect(host = "https://openeo.cloud") dc = datacube(id = "SENTINEL_5P_L2") # filter_temporal and filter_bbox diff --git a/man/group_by.Rd b/man/group_by.Rd index b84c37c..f69e323 100644 --- a/man/group_by.Rd +++ b/man/group_by.Rd @@ -17,7 +17,7 @@ .intervals = NULL, .labels = array(), .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -117,7 +117,7 @@ aggregate_temporal runs. \examples{ library(tidyopeneo) library(sf) - +con = connect(host = "https://openeo.cloud") # bounding box w = 6.09 s = 46.15 diff --git a/man/mutate.Rd b/man/mutate.Rd index 17f416e..4eaf333 100644 --- a/man/mutate.Rd +++ b/man/mutate.Rd @@ -19,7 +19,7 @@ .size = NULL, .overlap = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -111,7 +111,7 @@ For **apply_neighborhood** define .data, .process, size, and, optionally, } \examples{ library(tidyopeneo) - +con = connect(host = "https://openeo.cloud") dc = datacube(id = "SENTINEL_5P_L2") # apply diff --git a/man/rename.Rd b/man/rename.Rd index 7cee774..e6e5728 100644 --- a/man/rename.Rd +++ b/man/rename.Rd @@ -11,7 +11,7 @@ .source, .target, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -38,6 +38,7 @@ Rename datacube dimension wraps the rename_dimension(https://processes.openeo.o } \examples{ library(tidyopeneo) +con = connect(host = "https://openeo.cloud") # bounding box w = 6.09 diff --git a/man/resample.Rd b/man/resample.Rd index 5c0642e..a8fb7e9 100644 --- a/man/resample.Rd +++ b/man/resample.Rd @@ -16,7 +16,7 @@ resample( .valid_within = NULL, .target_process = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) \method{resample}{datacube}( @@ -30,7 +30,7 @@ resample( .valid_within = NULL, .target_process = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -113,6 +113,7 @@ be run, or if "temporal" is set, resample_cube_temporal is gonna be run. } \examples{ library(tidyopeneo) +con = connect(host = "https://openeo.cloud") # bounding box w = 6.09 diff --git a/man/select.Rd b/man/select.Rd index a183120..d86d097 100644 --- a/man/select.Rd +++ b/man/select.Rd @@ -11,7 +11,7 @@ .bands = NULL, .wavelength = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -47,6 +47,7 @@ into a simulated dplyr's \code{\link[dplyr]{select}}. } \examples{ library(tidyopeneo) +con = connect(host = "https://openeo.cloud") dc = datacube(id = "SENTINEL_5P_L2") dc_no2 <- dc \%>\% select(.bands = "NO2") diff --git a/man/slice.Rd b/man/slice.Rd index 7c33835..cdbdc97 100644 --- a/man/slice.Rd +++ b/man/slice.Rd @@ -11,7 +11,7 @@ n = 1, prop = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -49,6 +49,7 @@ interpreted as "days". } \examples{ library(tidyopeneo) +con = connect(host = "https://openeo.cloud") dc = datacube("TERRASCOPE_S5P_L3_NO2_TD_V1") diff --git a/man/summarise.Rd b/man/summarise.Rd index 48b888c..49bb06b 100644 --- a/man/summarise.Rd +++ b/man/summarise.Rd @@ -12,7 +12,7 @@ .dimension = NULL, .context = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -43,7 +43,7 @@ Summarise datacube wraps the reduce_dimension(https://processes.openeo.org/#redu } \examples{ library(tidyopeneo) - +con = connect(host = "https://openeo.cloud") # bounding box w = 6.09 s = 46.15 diff --git a/man/summarize.Rd b/man/summarize.Rd index 29d03a0..358024d 100644 --- a/man/summarize.Rd +++ b/man/summarize.Rd @@ -12,7 +12,7 @@ .dimension = NULL, .context = NULL, .p = openeo::processes(.con), - .con = openeo::connect("https://openeo.cloud") + .con = NULL ) } \arguments{ @@ -43,6 +43,7 @@ Summarize datacube wraps the reduce_dimension(https://processes.openeo.org/#redu } \examples{ library(tidyopeneo) +con = connect(host = "https://openeo.cloud") # bounding box w = 6.09 diff --git a/vignettes/my-vignette.Rmd b/vignettes/my-vignette.Rmd index d7d2da8..18814a1 100644 --- a/vignettes/my-vignette.Rmd +++ b/vignettes/my-vignette.Rmd @@ -19,7 +19,7 @@ The **tidyopeneo** package was created with the intention to make the [openeo](h ```{r processes, echo=TRUE} library(openeo) -con = con = connect(host = "https://openeo.cloud") +con = connect(host = "https://openeo.cloud") p = processes() dc = p$load_collection(