The goal of GAEZr is to facilitate downloading and processing of GAEZ v4 data in R. The main functionality is to download raster data via the gaez_download() function from this GAEZ web viewer:

You can install the development version of GAEZr like so:
remotes::install_github(repo = "floswald/GAEZr")Download wheat potential yields under the 1981-2010 climate.
library(GAEZr)
gaez_download("whe")Download potential yields for all crops and all scenarios