You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
That is actually very imformative, and solves your problem:
reproducible::Require(raster) # works fine
reproducible::Require(raster) # Error in Require(raster) : packages should be a character vector or a name
reproducible::Require("raster") # works fine, with no error or message
It "tries" the first time to use the "object" called raster... since it does not exist, it tries to interpret it as a character string. The second time, the package is loaded, so the "object" called raster does exist. So, it tries to load that object (it is the function raster::raster). The third, and correct time, is the best way to always load a library/package in R. It does "work" in base R to use require(raster) ... but that not great for Require for some other reasons.
reprex:
The text was updated successfully, but these errors were encountered: