{"id":13704094,"url":"https://github.com/r-spatial/rgee","last_synced_at":"2025-05-14T05:10:22.628Z","repository":{"id":37460896,"uuid":"205997187","full_name":"r-spatial/rgee","owner":"r-spatial","description":"Google Earth Engine for R","archived":false,"fork":false,"pushed_at":"2025-05-13T02:27:28.000Z","size":33334,"stargazers_count":727,"open_issues_count":59,"forks_count":153,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-05-13T23:17:16.919Z","etag":null,"topics":["earth-engine","earthengine","google-earth-engine","googleearthengine","r","spatial-analysis","spatial-data"],"latest_commit_sha":null,"homepage":"https://r-spatial.github.io/rgee/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-spatial.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-03T05:38:52.000Z","updated_at":"2025-05-13T02:27:32.000Z","dependencies_parsed_at":"2023-10-20T22:43:59.566Z","dependency_job_id":"ea7679b2-d104-43c6-87f3-268d2635dec3","html_url":"https://github.com/r-spatial/rgee","commit_stats":{"total_commits":1164,"total_committers":23,"mean_commits":"50.608695652173914","dds":0.6219931271477663,"last_synced_commit":"5b5c7743b80235e306b2b00d9819fec77edceded"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Frgee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Frgee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Frgee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Frgee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-spatial","download_url":"https://codeload.github.com/r-spatial/rgee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059507,"owners_count":22007768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earth-engine","earthengine","google-earth-engine","googleearthengine","r","spatial-analysis","spatial-data"],"created_at":"2024-08-02T21:01:04.158Z","updated_at":"2025-05-14T05:10:22.603Z","avatar_url":"https://github.com/r-spatial.png","language":"R","funding_links":["https://www.buymeacoffee.com/csay"],"categories":["R","Geospatial Library","Planning Coding Resources","Google Earth Engine","Earth Engine","Sustainable Development"],"sub_categories":["Packages","R","Testing your code","Data Catalogs and Interfaces"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/r-spatial/rgee/\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/16768318/118376965-5f7dca80-b5cb-11eb-9a82-47876680a3e6.png\" alt=\"Markdownify\" width=\"200\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/r-earthengine/rgeeExtra/\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/16768318/118376968-63a9e800-b5cb-11eb-83e7-3f36299e17cb.png\" alt=\"Markdownify\" width=\"200\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://r-earthengine.com/rgeebook/\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/16768318/118376966-60aef780-b5cb-11eb-8df2-ca70dcfe04c5.png\" alt=\"Markdownify\" width=\"200\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  rgee: Google Earth Engine for R\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\n\u003ch4 align=\"center\"\u003ergee is an R binding package for calling \u003ca href=\"https://developers.google.com/earth-engine/\" target=\"_blank\"\u003eGoogle Earth Engine API\u003c/a\u003e from within R. \u003ca href=\"https://r-spatial.github.io/rgee/reference/index.html\" target=\"_blank\"\u003eVarious functions\u003c/a\u003e are implemented to simplify the connection with the R spatial ecosystem.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://colab.research.google.com/github/r-spatial/rgee/blob/examples/rgee_colab.ipynb\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\" title=\"Open and Execute in Google Colaboratory\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/r-spatial/rgee/actions\"\u003e\u003cimg src=\"https://github.com/r-spatial/rgee/workflows/R-CMD-check/badge.svg\" alt=\"R build status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.repostatus.org/#active\"\u003e\u003cimg src=\"https://www.repostatus.org/badges/latest/active.svg\" alt=\"Project Status: Active – The project has reached a stable, usable\nstate and is being actively\ndeveloped.\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/r-spatial/rgee\"\u003e\u003cimg src=\"https://codecov.io/gh/r-spatial/rgee/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.tidyverse.org/lifecycle/#maturing\"\u003e\u003cimg src=\"https://img.shields.io/badge/lifecycle-maturing-blue.svg\" alt=\"lifecycle\"\u003e\u003c/a\u003e\n\u003ca href=\"https://joss.theoj.org/papers/aea42ddddd79df480a858bc1e51857fc\"\u003e\u003cimg src=\"https://joss.theoj.org/papers/aea42ddddd79df480a858bc1e51857fc/status.svg\" alt=\"status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cran.r-project.org/package=rgee\"\u003e\u003cimg src=\"https://www.r-pkg.org/badges/version/rgee\" alt=\"CRAN\nstatus\"\u003e\u003c/a\u003e\n\u003ca href=\"https://doi.org/10.5281/zenodo.3945409\"\u003e\u003cimg src=\"https://zenodo.org/badge/DOI/10.5281/zenodo.3945409.svg\" alt=\"DOI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cran.r-project.org/web/packages/rgee/index.html\"\u003e\u003cimg src=\"https://cranlogs.r-pkg.org/badges/rgee\" alt=\"CRAN status\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003ca href=\"https://www.buymeacoffee.com/csay\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#hello-world\"\u003eHello World\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#how-does-rgee-work\"\u003eHow does rgee work?\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#quick-start-users-guide-for-rgee\"\u003eGuides\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#contributing-guide\"\u003eContributing\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#share-the-love\"\u003eCitation\u003c/a\u003e \u0026nbsp;•\n  \u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e\n\u003c/p\u003e\n\n## What is Google Earth Engine?\n\n[Google Earth Engine](https://earthengine.google.com/) is a cloud-based platform that enables users to access a petabyte-scale archive of remote sensing data and conduct geospatial analysis on Google's infrastructure. Currently, Google offers support only for Python and JavaScript. `rgee` fills that gap **by providing support for R!**. Below, you will find a comparison between the syntax of `rgee` and the two other client libraries supported by Google.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e JS (Code Editor) \u003c/th\u003e\n\u003cth\u003e Python \u003c/th\u003e\n\u003cth\u003e R \u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n``` javascript\nvar db = 'CGIAR/SRTM90_V4'\nvar image = ee.Image(db)\nprint(image.bandNames())\n#\u003e 'elevation'\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n``` python\nimport ee\nee.Initialize(project = \"my-project-id\")\ndb = 'CGIAR/SRTM90_V4'\nimage = ee.Image(db)\nimage.bandNames().getInfo()\n#\u003e [u'elevation']\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n``` r\nlibrary(rgee)\nee_Initialize(project = \"my-project-id\")\ndb \u003c- 'CGIAR/SRTM90_V4'\nimage \u003c- ee$Image(db)\nimage$bandNames()$getInfo()\n#\u003e [1] \"elevation\"\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n**Quite similar, isn't it?**. However, additional more minor changes should be considered when using Google Earth Engine with R. Please check the [consideration section](https://r-spatial.github.io/rgee/articles/rgee02.html) before you start coding!\n\n## How to use\n\n**NOTE: Create a [.Renviron file](https://cran.r-project.org/web/packages/startup/vignettes/startup-intro.html) file to prevent setting RETICULATE_PYTHON and EARTHENGINE_GCLOUD every time you authenticate/init your account.**\n\n``` r\nlibrary(rgee)\n\n# Set your Python ENV\nSys.setenv(\"RETICULATE_PYTHON\" = \"/usr/bin/python3\")\n\n# Set Google Cloud SDK. Only need it the first time you log in. \nSys.setenv(\"EARTHENGINE_GCLOUD\" = \"home/csaybar/google-cloud-sdk/bin/\")\nee_Authenticate()\n\n# Initialize your Earth Engine Session \nee_Initialize(project = \"my-project-id\")\n```\n\n### Earth Engine initialization \n\nYou will need to create and register a Google Cloud project to use Earth Engine (via rgee).\nSee the following \"Installation\" section for instructions. The ID of the Cloud project will need to\nbe supplied to `ee_Initialize` each time you start a new rgee session. Whenever you see \"my-project-id\"\nin rgee example code, replace the string with your specific Cloud project ID. For more information on\nthese topics see about [Earth Engine access](https://developers.google.com/earth-engine/guides/access)\nand [authentication and inialization](https://developers.google.com/earth-engine/guides/auth) pages. \n\n## Installation\n\nInstall from CRAN with:\n\n``` r\ninstall.packages(\"rgee\")\n```\n\nInstall the development versions from github with\n\n``` r\nlibrary(remotes)\ninstall_github(\"r-spatial/rgee\")\n```\n\nFurthermore, `rgee` depends on [numpy](https://pypi.org/project/numpy/) and [earthengine-api](https://pypi.org/project/earthengine-api/) and it requires **[gcloud CLI](https://cloud.google.com/sdk/docs/install#deb)** to authenticate new users. The following example shows how to install and set up 'rgee' on a new Ubuntu computer. If you intend to use rgee on a server, please refer to this example in RStudio Cloud.\" -- https://posit.cloud/content/5175749)\n\nCreate and register a Google Cloud project. Follow the [Earth Engine access](\n  https://developers.google.com/earth-engine/guides/access#get_access_to_earth_engine) instructions. \n\n``` r\ninstall.packages(c(\"remotes\", \"googledrive\"))\nremotes::install_github(\"r-spatial/rgee\")\n\nlibrary(rgee)\n\n# Get the username\nHOME \u003c- Sys.getenv(\"HOME\")\n\n# 1. Install miniconda\nreticulate::install_miniconda()\n\n# 2. Install Google Cloud SDK\nsystem(\"curl -sSL https://sdk.cloud.google.com | bash\")\n\n# 3 Set global parameters\nSys.setenv(\"RETICULATE_PYTHON\" = sprintf(\"%s/.local/share/r-miniconda/bin/python3\", HOME))\nSys.setenv(\"EARTHENGINE_GCLOUD\" = sprintf(\"%s/google-cloud-sdk/bin/\", HOME))\n\n# 4 Install rgee Python dependencies\nee_install() \n\n# 5. Authenticate and initialize your Earth Engine session\n# Replace \"my-project-id\" with the ID of the Cloud project you created above \nee_Initialize(project = \"my-project-id\") \n```\n\nThere are three (3) different ways to install rgee Python dependencies:\n\n1.  Use [**ee_install**](https://r-spatial.github.io/rgee/reference/ee_install.html) (Highly recommended for users with no experience with Python environments)\n\n``` r\nrgee::ee_install()\n```\n\n2.  Use [**ee_install_set_pyenv**](https://r-spatial.github.io/rgee/reference/ee_install_set_pyenv.html) (Recommended for users with experience in Python environments)\n\n``` r\nrgee::ee_install_set_pyenv(\n  py_path = \"/home/csaybar/.virtualenvs/rgee/bin/python\", # Change it for your own Python PATH\n  py_env = \"rgee\" # Change it for your own Python ENV\n)\n```\n\nTake into account that the Python PATH you set must have earthengine-api and `numpy installed. The use of **miniconda/anaconda is mandatory for Windows users,** Linux and MacOS users could also use virtualenv. See [reticulate](https://rstudio.github.io/reticulate/articles/python_packages.html) documentation for more details.\n\nIf you are using MacOS or Linux, you can choose setting the Python PATH directly:\n\n``` r\nrgee::ee_install_set_pyenv(\n  py_path = \"/usr/bin/python3\",\n  py_env = NULL\n)\n```\n\nHowever, [**rgee::ee_install_upgrade**](https://r-spatial.github.io/rgee/reference/ee_install_upgrade.html) and [**reticulate::py_install**](https://rstudio.github.io/reticulate/reference/py_install.html) will not work until you have set up a Python ENV.\n\n3.  Use the Python PATH setting support that offer [Rstudio v.1.4 \\\u003e](https://blog.rstudio.com/2020/10/07/rstudio-v1-4-preview-python-support/). See this [tutorial](https://github.com/r-spatial/rgee/tree/help/rstudio/).\n\nAfter install `Python dependencies`, you might want to use the function below for checking the rgee status.\n\n``` r\nee_check() # Check non-R dependencies\n```\n\n## Sync rgee with other Python packages\n\nIntegrate [rgee](https://r-spatial.github.io/rgee/) with [geemap](https://geemap.org/).\n\n``` r\nlibrary(reticulate)\nlibrary(rgee)\n\n# 1. Initialize the Python Environment\nee_Initialize(project = \"my-project-id\")\n\n# 2. Install geemap in the same Python ENV that use rgee\npy_install(\"geemap\")\ngm \u003c- import(\"geemap\")\n```\n\nUpgrade the [earthengine-api](https://pypi.org/project/earthengine-api/)\n\n``` r\nlibrary(rgee)\nee_Initialize(project = \"my-project-id\")\nee_install_upgrade()\n```\n\n## Package Conventions\n\n-   All `rgee` functions have the prefix ee\\_. Auto-completion is your best ally :).\n-   Full access to the Earth Engine API with the prefix [**ee\\$...**](https://developers.google.com/earth-engine/).\n-   Authenticate and Initialize the Earth Engine R API with [**ee_Initialize**](https://r-spatial.github.io/rgee/reference/ee_Initialize.html). It is necessary once per session!.\n-   `rgee` is \"pipe-friendly\"; we re-export %\\\u003e% but do not require to use it.\n\n## Hello World\n\n### 1. Compute the trend of night-time lights ([JS version](https://github.com/google/earthengine-api/))\n\nAuthenticate and Initialize the Earth Engine R API.\n\n``` r\nlibrary(rgee)\nee_Initialize(project = \"my-project-id\")\n```\n\nLet's create a new band containing the image date as years since 1991 by extracting the year of the image acquisition date and subtracting it from 1991.\n\n``` r\ncreateTimeBand \u003c-function(img) {\n  year \u003c- ee$Date(img$get('system:time_start'))$get('year')$subtract(1991L) \n  ee$Image(year)$byte()$addBands(img)\n}\n```\n\nUse your TimeBand function to map it over the [night-time lights collection](https://developers.google.com/earth-engine/datasets/catalog/NOAA_DMSP-OLS_NIGHTTIME_LIGHTS/).\n\n``` r\ncollection \u003c- ee$\n  ImageCollection('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS')$\n  select('stable_lights')$\n  map(createTimeBand)\n```\n\nCompute a linear fit over the series of values at each pixel, so that you can visualize the y-intercept as green, and the positive/negative slopes as red/blue.\n\n``` r\ncol_reduce \u003c- collection$reduce(ee$Reducer$linearFit())\ncol_reduce \u003c- col_reduce$addBands(\n  col_reduce$select('scale'))\nee_print(col_reduce)\n```\n\nLet's visualize our map!\n\n``` r\nMap$setCenter(9.08203, 47.39835, 3)\nMap$addLayer(\n  eeObject = col_reduce,\n  visParams = list(\n    bands = c(\"scale\", \"offset\", \"scale\"),\n    min = 0,\n    max = c(0.18, 20, -0.18)\n  ),\n  name = \"stable lights trend\"\n)\n```\n\n![rgee_01](https://user-images.githubusercontent.com/16768318/71565699-51e4a500-2aa9-11ea-83c3-9e1d32c82ba6.png)\n\n### 2. Let's play with some precipitation values\n\nInstall and load `tidyverse` and `sf` R packages, and initialize the Earth Engine R API.\n\n``` r\nlibrary(tidyverse)\nlibrary(rgee)\nlibrary(sf)\n\nee_Initialize(project = \"my-project-id\")\n```\n\nRead the `nc` shapefile.\n\n``` r\nnc \u003c- st_read(system.file(\"shape/nc.shp\", package = \"sf\"), quiet = TRUE)\n```\n\nWe will use the [Terraclimate dataset](https://developers.google.com/earth-engine/datasets/catalog/IDAHO_EPSCOR_TERRACLIMATE/) to extract the monthly precipitation (Pr) from 2001\n\n``` r\nterraclimate \u003c- ee$ImageCollection(\"IDAHO_EPSCOR/TERRACLIMATE\") %\u003e%\n  ee$ImageCollection$filterDate(\"2001-01-01\", \"2002-01-01\") %\u003e%\n  ee$ImageCollection$map(function(x) x$select(\"pr\")) %\u003e% # Select only precipitation bands\n  ee$ImageCollection$toBands() %\u003e% # from imagecollection to image\n  ee$Image$rename(sprintf(\"PP_%02d\",1:12)) # rename the bands of an image\n```\n\n`ee_extract` will help you to extract monthly precipitation values from the Terraclimate ImageCollection. `ee_extract` works similar to `raster::extract`, you just need to define: the ImageCollection object (x), the geometry (y), and a function to summarize the values (fun).\n\n``` r\nee_nc_rain \u003c- ee_extract(x = terraclimate, y = nc[\"NAME\"], sf = FALSE)\n```\n\nUse ggplot2 to generate a beautiful static plot!\n\n``` r\nee_nc_rain %\u003e%\n  pivot_longer(-NAME, names_to = \"month\", values_to = \"pr\") %\u003e%\n  mutate(month, month=gsub(\"PP_\", \"\", month)) %\u003e%\n  ggplot(aes(x = month, y = pr, group = NAME, color = pr)) +\n  geom_line(alpha = 0.4) +\n  xlab(\"Month\") +\n  ylab(\"Precipitation (mm)\") +\n  theme_minimal()\n```\n\n\u003cp align=\"center\"\u003e\n\n  \u003cimg src=\"https://user-images.githubusercontent.com/16768318/81945044-2cbd8280-95c3-11ea-9ef5-fd9f6fd5fe89.png\" width=\"80%\"/\u003e\n\n  \u003c/p\u003e\n\n  ### 3. Create an NDVI-animation ([JS version](https://developers.google.com/earth-engine/tutorials/community/modis-ndvi-time-series-animation/))\n\n Install and load `sf`. after that, initialize the Earth Engine R API.\n\n``` r\nlibrary(magick)\nlibrary(rgee)\nlibrary(sf)\n\nee_Initialize(project = \"my-project-id\")\n```\n\nDefine the regional bounds of animation frames and a mask to clip the NDVI data by.\n\n``` r\nmask \u003c- system.file(\"shp/arequipa.shp\", package = \"rgee\") %\u003e%\n  st_read(quiet = TRUE) %\u003e%\n  sf_as_ee()\nregion \u003c- mask$geometry()$bounds()\n```\n\nRetrieve the MODIS Terra Vegetation Indices 16-Day Global 1km dataset as an `ee.ImageCollection` and then, select the NDVI band.\n\n``` r\ncol \u003c- ee$ImageCollection('MODIS/006/MOD13A2')$select('NDVI')\n```\n\nGroup images by composite date\n\n``` r\ncol \u003c- col$map(function(img) {\n  doy \u003c- ee$Date(img$get('system:time_start'))$getRelative('day', 'year')\n  img$set('doy', doy)\n})\ndistinctDOY \u003c- col$filterDate('2013-01-01', '2014-01-01')\n```\n\nNow, let's define a filter that identifies which images from the complete collection match the DOY from the distinct DOY collection.\n\n``` r\nfilter \u003c- ee$Filter$equals(leftField = 'doy', rightField = 'doy')\n```\n\nDefine a join and convert the resulting FeatureCollection to an ImageCollection... it will take you only 2 lines of code!\n\n``` r\njoin \u003c- ee$Join$saveAll('doy_matches')\njoinCol \u003c- ee$ImageCollection(join$apply(distinctDOY, col, filter))\n```\n\nApply median reduction among the matching DOY collections.\n\n``` r\ncomp \u003c- joinCol$map(function(img) {\n  doyCol = ee$ImageCollection$fromImages(\n    img$get('doy_matches')\n  )\n  doyCol$reduce(ee$Reducer$median())\n})\n```\n\nAlmost ready! but let's define RGB visualization parameters first.\n\n``` r\nvisParams = list(\n  min = 0.0,\n  max = 9000.0,\n  bands = \"NDVI_median\",\n  palette = c(\n    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',\n    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',\n    '012E01', '011D01', '011301'\n  )\n)\n```\n\nCreate RGB visualization images for use as animation frames.\n\n``` r\nrgbVis \u003c- comp$map(function(img) {\n  do.call(img$visualize, visParams) %\u003e%\n    ee$Image$clip(mask)\n})\n```\n\nLet's animate this. Define GIF visualization parameters.\n\n``` r\ngifParams \u003c- list(\n  region = region,\n  dimensions = 600,\n  crs = 'EPSG:3857',\n  framesPerSecond = 10\n)\n```\n\nGet month names\n\n``` r\ndates_modis_mabbr \u003c- distinctDOY %\u003e%\n  ee_get_date_ic %\u003e% # Get Image Collection dates\n  '[['(\"time_start\") %\u003e% # Select time_start column\n  lubridate::month() %\u003e% # Get the month component of the datetime\n  '['(month.abb, .) # subset around month abbreviations\n```\n\nAnd finally, use ee_utils_gif\\_\\* functions to render the GIF animation and add some texts.\n\n``` r\nanimation \u003c- ee_utils_gif_creator(rgbVis, gifParams, mode = \"wb\")\nanimation %\u003e%\n  ee_utils_gif_annotate(\n    text = \"NDVI: MODIS/006/MOD13A2\",\n    size = 15, color = \"white\",\n    location = \"+10+10\"\n  ) %\u003e%\n  ee_utils_gif_annotate(\n    text = dates_modis_mabbr,\n    size = 30,\n    location = \"+290+350\",\n    color = \"white\",\n    font = \"arial\",\n    boxcolor = \"#000000\"\n  ) # -\u003e animation_wtxt\n\n# ee_utils_gif_save(animation_wtxt, path = \"raster_as_ee.gif\")\n```\n\n\u003cp align=\"center\"\u003e\n\n  \u003cimg src=\"https://user-images.githubusercontent.com/16768318/77121867-203e0300-6a34-11ea-97ba-6bed74ef4300.gif\"/\u003e\n\n  \u003c/p\u003e\n\n  ## How does rgee work?\n\n\n  `rgee` is **not** a native Earth Engine API like the Javascript or Python client. Developing an Earth Engine API from scratch would create too much maintenance burden, especially considering that the API is in [active development](https://github.com/google/earthengine-api). So, how is it possible to run Earth Engine using R? the answer is [reticulate]! (https://rstudio.github.io/reticulate/). `reticulate` is an R package designed to allow seamless interoperability between R and Python. When an Earth Engine **request** is created in R, `reticulate` will translate this request into Python and pass it to the `Earth Engine Python API`, which  converts the request to a `JSON` format. Finally, the request is received by the GEE Platform through a Web REST API. The **response** will follow the same path in reverse.\n\n![workflow](https://user-images.githubusercontent.com/16768318/71569603-3341d680-2ac8-11ea-8787-4dd1fbba326f.png)\n\n## Code of Conduct\n\n  Please note that the `rgee` project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.\n\n## Contributing Guide\n\n👍 Thanks for taking the time to contribute! 🎉👍 Please review our [Contributing Guide](CONTRIBUTING.md).\n\n## Share the love\n\nEnjoying **rgee**? Let others know about it! Share it on Twitter, LinkedIN or in a blog post to spread the word.\n\nUsing **rgee** for your scientific article? here's how you can cite it\n\n``` r\ncitation(\"rgee\")\nTo cite rgee in publications use:\n\n  C Aybar, Q Wu, L Bautista, R Yali and A Barja (2020) rgee: An R\n  package for interacting with Google Earth Engine Journal of Open\n  Source Software URL https://github.com/r-spatial/rgee/.\n\nA BibTeX entry for LaTeX users is\n\n@Article{,\n  title = {rgee: An R package for interacting with Google Earth Engine},\n  author = {Cesar Aybar and Quisheng Wu and Lesly Bautista and Roy Yali and Antony Barja},\n  journal = {Journal of Open Source Software},\n  year = {2020},\n}\n```\n\n## Credits\n\nWe want to offer a **special thanks** :raised_hands: :clap: to [**Justin Braaten**](https://github.com/jdbcode) for his wise and helpful comments in the whole development of **rgee**. As well, we would like to mention the following third-party R/Python packages for contributing indirectly to the improvement of rgee:\n\n-   [**gee_asset_manager - Lukasz Tracewski**](https://github.com/tracek/gee_asset_manager/)\n-   [**geeup - Samapriya Roy**](https://github.com/samapriya/geeup/)\n-   [**geeadd - Samapriya Roy**](https://github.com/samapriya/gee_asset_manager_addon/)\n-   [**cartoee - Kel Markert**](https://github.com/KMarkert/cartoee/)\n-   [**geetools - Rodrigo E. Principe**](https://github.com/gee-community/gee_tools/)\n-   [**landsat-extract-gee - Loïc Dutrieux**](https://github.com/loicdtx/landsat-extract-gee/)\n-   [**earthEngineGrabR - JesJehle**](https://github.com/JesJehle/earthEngineGrabR/)\n-   [**sf - Edzer Pebesma**](https://github.com/r-spatial/sf/)\n-   [**stars - Edzer Pebesma**](https://github.com/r-spatial/stars/)\n-   [**gdalcubes - Marius Appel**](https://github.com/appelmar/gdalcubes/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatial%2Frgee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-spatial%2Frgee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatial%2Frgee/lists"}