What does “not run” mean in R help pages?

后端 未结 5 1528
抹茶落季
抹茶落季 2020-12-02 09:47

Sometimes on an R help page the phrase \"not run\" appears in comments. Check out this from the help page for \"with()\":

Examples
require(stats); require(gr         


        
5条回答
  •  一个人的身影
    2020-12-02 10:13

    In "Writing R Extensions" manual, in section about \examples{...} is said that

    You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands for testing that should not be shown to users, but will be run by example()

    When you build a package then all code in \dontrun{} closure is visible in help as

    ## Not run:
    ...
    ## End(**Not run**)
    

    edit: This answer was earlier.

提交回复
热议问题