The code in https://github.com/pharmpy/pharmr/blob/main/R/internals.R should be added when creating the R wrapper so that the wrapper is self contained.