Google Cloud SDK is an optional dependency, required to search and download SAFE archives from Google Cloud.

check_gcloud() checks if Google Cloud SDK is externally installed and if a user account is set.

is_gcloud_configured() check if Google Cloud SDK were already configured in sen2r using check_gcloud().

check_gcloud_connection() check if internet connection is available and Sentinel-2 bucket is accessible on Google Cloud.

  force = FALSE,
  full_scan = FALSE,
  abort = TRUE,
  check_creds = TRUE





(optional) Character: the path of the gsutil executable, or the directory in which it is installed. If not provided, gsutil is searched in the system path.


(optional) Logical: if TRUE, check even if it is already configured (default is FALSE).


(optional) Logical: in Linux and MacOS, if gsutil_dir was not manually defined, gsutil is searched within the system path in case this argument is left to default value FALSE; instead, if TRUE, a full search is performed. In Windows, if the folder Google\Cloud SDK exist in C:\Program Files (x86), C:\Program Files or C:\Users\<username>\AppData\Local, then gsutil is searched there, otherwise in the main directory C:\; setting full_scan = TRUE, is is always searched in the whole C:\. This argument takes no effect if gsutil_dir was defined, since, in that case, a full search is always performed in gsutil_dir.


(optional) Logical: if TRUE (default), the function aborts in case no Google Cloud SDK installation is found; if FALSE, a warning is shown and FALSE is returned.


(optional) Logical: if TRUE, check also if a user account (required to search and download products) was set.


check_gcloud() returns TRUE (invisible) in case Google Cloud SDK was correctly set, FALSE if it was not found, not configured (if check_creds = TRUE) and abort = FALSE (otherwise, the function stops).

is_gcloud_configured() returns TRUE if Google Cloud SDK is installed and an account is configured, FALSE if not.

check_gcloud_connection() returns TRUE if connection is available, FALSE otherwise.


License: GPL 3.0


L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. doi: 10.1016/j.cageo.2020.104473 , URL:


Luigi Ranghetti, phD (2021)


if (FALSE) { check_gcloud() check_gcloud_connection() } # \donttest{ is_gcloud_configured()
#> [1] TRUE
# }