'object 'rlang_hash' not found' when using MODISTools functions in R

930 Views Asked by At

I am trying to follow the steps on the documentation and use the MODISTools R package to download Land Cover data.

I installed MODISTools and imported the library into my R session

install.packages("MODISTools")
library(MODISTools)

Then when I try to run any mt_*() function, I get the following error.

mt_products()

Error in encl$_hash(c(encl$_f_hash, args, lapply(encl$_additional, : object 'rlang_hash' not found

2

There are 2 best solutions below

0
On BEST ANSWER

Updating the version of rlang package to 0.4.10 worked

3
On

Tried the OP's code and it is working in R 4.0.4 and rlang version 0.4.10

library(MODISTools)
products <- mt_products()
str(products)
'data.frame':   34 obs. of  4 variables:
 $ product          : chr  "Daymet" "ECO4ESIPTJPL" "ECO4WUE" "MCD12Q1" ...
 $ description      : chr  "Daily Surface Weather Data (Daymet) on a 1-km Grid for North America, Version 4" "ECOSTRESS Evaporative Stress Index PT-JPL (ESI) Daily L4 Global 70 m" "ECOSTRESS Water Use Efficiency (WUE) Daily L4 Global 70 m" "MODIS/Terra+Aqua Land Cover Type (LC) Yearly L3 Global 500 m SIN Grid" ...
 $ frequency        : chr  "1 day" "Varies" "Varies" "1 year" ...
 $ resolution_meters: int  1000 70 70 500 500 500 500 1000 500 500 ...