gadget-framework / gadget3

TMB-based gadget implemtation
GNU General Public License v2.0
8 stars 6 forks source link

Error in ...names() : could not find function "...names" #82

Closed MikkoVihtakari closed 1 year ago

MikkoVihtakari commented 1 year ago

While trying to compile a model on Daniel's Windows machine (R 4.0) we encountered following issue:

g3_stock("test", lengthgroups = 1:5) %>% g3s_livesonareas(areas[c('1')])
Error in ...names() : could not find function "...names"

...names() was apparently introduced by R 4.1. I don't see that this function would have been used in g3s_livesonareas(), right?

Is it perhaps used by the most recent version of rlang? Or some other tidyverse packages? Can we get rid of those dependencies somehow? Or am I lost with my reasoning?

lentinj commented 1 year ago

It's in gadget3 itself:

https://github.com/gadget-framework/gadget3/blob/4420ddca38f342f247a8a2b87f494b335aae113d/R/formula_utils.R#L41-L43

https://github.com/gadget-framework/gadget3/blob/4420ddca38f342f247a8a2b87f494b335aae113d/R/run.R#L65

...in both cases, rewriting wouldn't be too much of a bother. This is being picked up by "oldrel-1", yes?

MikkoVihtakari commented 1 year ago

...in both cases, rewriting wouldn't be too much of a bother. This is being picked up by "oldrel-1", yes?

No, on a Windows machine with R 4.0.

lentinj commented 1 year ago

oldrel-2 would be 4.0, and pick this up. Seems like a reasonable compromise in what we support.

Tidyverse policy is oldrel-4. This seems a bit extreme for our purposes though. I'd like to get to 4.1 being the minimum version in the not too distant future, so we can use the native pipe in examples.

Regardless, should update the CI to check this, and add something into the rversions API and auto-update the DESCRIPTION, both here and MFDB.

lentinj commented 1 year ago

We have tests now with oldrel-1 and oldrel-2, which pass. As well as the ..names() problems there were scattered instances of native-pipe, which was predictable.

The release process will update the DESCRIPTION with a new minimum version of R if required, so we should be good here.