What does the Autoloads environment do?

后端 未结 1 1810
北荒
北荒 2021-02-19 03:09

The second-to-last item on the search() path is (always?) an environment called Autoloads. All I could find about this topic is a sentence on page 26

相关标签:
1条回答
  • 2021-02-19 03:48

    Autoloading provides a way of loading packages in the future, only at the point at which they are used (if at all). So if a function from a package may soon be used, but (for memory reasons, perhaps) you don't want to load the package unless absolutely necessary, you can use the autoload function to promise to make a function available if it is used.

    The Autoloads environment (accessible via as.environment("Autoloads") or .AutoloadEnv) stores the functions that it will promise to load and a character vector, .Autoloaded, that names the packages that need to be loaded.

    Further information can be found in the ?autoload help page and R-FAQ 7.6.

    0 讨论(0)
提交回复
热议问题