Calling a function from a namespace

前端 未结 2 1702
独厮守ぢ
独厮守ぢ 2020-12-08 07:26

I\'m trying to alter the functionality of a few commands in a package in R. It\'s easy enough to see the source of the commands. However the function calls other functions t

2条回答
  •  天涯浪人
    2020-12-08 08:06

    When developing, ?assignInNamespace is very useful.

    This allows you to inject a new copy of a non-exported function into a package's namespace.

    It would be nice if R's error message was more helpful. Instead of:

    Error: 'matrixToPaths' is not an exported object from 'namespace:OpenMx'
    

    Why not add:

    You might try OpenMx:::matrixToPaths"
    

提交回复
热议问题