climr icon indicating copy to clipboard operation
climr copied to clipboard

Error in values(template) : could not find function "values"

Open cmahony opened this issue 1 year ago • 3 comments

error when downloading time series data:

> my_data <- plot_timeSeries_input(my_points)
Welcome to climr!
Getting normals...
Retrieving from cache...
Not fully cached :( Will download more
Downloading obs anomalies
Caching data...
Not fully cached :( Will download more
Downloading obs anomalies
Caching data...
Not fully cached :( Will download more
.Error in values(template) : could not find function "values"

cmahony avatar Sep 12 '24 18:09 cmahony

it seems to caused by values() not being imported from terra in the R/gcm.R function. other functions were also missing: cells(), rowColFromCell(). I added these functions to the @importFrom terra list.

cmahony avatar Sep 12 '24 21:09 cmahony

the next thing i tripped up on was could not find function "ext<-" even though ext() was imported. i was able to bypass this by specifying terra::ext().

Welcome to climr!
Getting normals...
Retrieving from cache...
Retrieving from cache...
Retrieving from cache...
Not fully cached :( Will download more
.Error in ext(gcm_rast) <- ext(template) : could not find function "ext<-"

cmahony avatar Sep 12 '24 21:09 cmahony

@kdaust i didn't manage this as a pull request but please review. there may be a better fix than terra::ext() but it seems to work. otherwise this is ready to close.

cmahony avatar Sep 12 '24 21:09 cmahony