5

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

UseR10085
  • 7,120
  • 3
  • 24
  • 54
z star
  • 684
  • 6
  • 19

2 Answers2

4

Updating the version of rlang package to 0.4.10 worked

z star
  • 684
  • 6
  • 19
2

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 ...
akrun
  • 874,273
  • 37
  • 540
  • 662
  • products <- mt_products() still gives me the same error. Any idea how to fix? I tried reinstalling rlang as well – z star Feb 21 '21 at 23:47
  • 1
    @zstar I used `packageVersion('rlang')# [1] ‘0.4.10’` on `R 4.0.4` – akrun Feb 21 '21 at 23:48
  • Sweet! I had `rlang` version `'0.4.7'` installed, and somehow `update.packages()` didn;t update it. So removed and re-installed version `0.4.10` and works fine now – z star Feb 21 '21 at 23:56