Simplifies the interaction with the GEE API making it more R-like. Popular third-party GEE algorithms are made available to R users
• Installation • How does it work? • Example • Code of conduct • Contributing • Citation • Credits
The goal of rgeeExtra is to enhance the user experience ⚡ of Google Earth Engine (GEE) 🌐 for R enthusiasts by simplifying its syntax. While GEE's primary language is JavaScript, which diverges from R's structure, rgeeExtra serves as a bridge 🌉, offering R users a suite of tools and functions to navigate GEE's complexity with ease. This extension elevates R interaction with GEE through high-level 📈 abstractions and tailored functions, all adapted from the JavaScript API.
Python (ee) | R (rgee) | R (rgee + rgeeExtra) |
---|---|---|
import ee
ee.Initialize()
db = 'CGIAR/SRTM90_V4'
image = ee.Image(db)
image.bandNames().getInfo()
#> [u'elevation'] |
library(rgee)
ee_Initialize()
db <- 'CGIAR/SRTM90_V4'
image <- ee$Image(db)
image$bandNames()$getInfo()
#> [1] "elevation" |
library(rgee)
library(rgeeExtra)
ee_Initialize()
extra_Initialize()
image <- ee$Image$Dataset$CGIAR_SRTM90_V4
names(image)
#> [1] "elevation" |
You can install rgeeExtra from GitHub with:
remotes::install_github("r-earthengine/rgeeExtra")
For additional details on connecting GEE and R, refer to the documentation provided here. To set up an account, click here.
The rgeeExtra extends the following Earth Engine classes:
rgeeExtra develops and maintains new methods and constructors that extend the most popular GEE classes (e.g., ee$Feature$Extra\_...
). All third-party methods implemented by rgeeExtra start with Extra\_.
To learn more about all the functionalities that rgeeExtra offers, please refer to the article Features for additional information.
Look at this simple example to estimate the NDVI from a Landsat-8 Surface Reflectance image.
With rgee:
# Load 'rgee' and initialize GEE
library(rgee)
ee_Initialize()
# Compute squared NDVI from Landsat 8 image
img <- ee$Image("LANDSAT/LC08/C02/T1_L2/LC08_007067_20140822")$
normalizedDifference(c("SR_B5", "SR_B4"))$
pow(2)
# Visualize squared NDVI on map
Map$centerObject(img)
Map$addLayer(
eeObject = img,
visParams = list(
min = 0,
max = 0.2,
palette = c("brown", "yellow", "green")
),
name = "Squared NDVI")
With rgeeExtra:
# Load 'rgee' and initialize GEE
library(rgee)
library(rgeeExtra)
ee_Initialize()
extra_Initialize()
# Compute squared NDVI from Landsat 8 image
img <- ee$Image("LANDSAT/LC08/C02/T1_L2/LC08_007067_20140822")
ndvi <- ((img[["SR_B5"]] - img[["SR_B4"]]) / (img[["SR_B5"]] + img[["SR_B4"]])) ** 2
names(ndvi) <- "NDVI"
# Visualize squared NDVI on map
Map$centerObject(ndvi)
Map$addLayer(
eeObject = ndvi,
visParams = list(
min = 0,
max = 0.2,
palette = c("brown", "yellow", "green")
),
name = "Squared NDVI"
)
Please note that the rgeeExtra
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
👍 Thanks for taking the time to contribute! 🎉👍 Please review our Contributing Guide.
Think rgeeExtra is useful? Let others discover it, by telling them in person via Twitter or a blog post.
Using rgeeExtra for a paper you are writing? Consider citing it
citation("rgeeExtra")
To cite rgee in publications use:
C Aybar, Q Wu, L Bautista, R Yali and A Barja (2020) rgee: An R
package for interacting with Google Earth Engine Journal of Open
Source Software URL https://github.com/r-spatial/rgee/.
A BibTeX entry for LaTeX users is
@Article{,
title = {rgee: An R package for interacting with Google Earth Engine},
author = {Cesar Aybar and Quisheng Wu and Lesly Bautista and Roy Yali and Antony Barja},
journal = {Journal of Open Source Software},
year = {2020},
}
We would like to mention the following third-party R/Python packages for contributing indirectly to the improvement of rgeeExtra: