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

后端 未结 5 1530
抹茶落季
抹茶落季 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:07

    C & p from Chapter 5.4 (R Documentation Files) of the MUST-TO-READ Creating R Packages: A Tutorial by Friedrich Leisch:

    The examples section should contain executable R code, and automatically running the code is part of checking a package. There are two special markup commands for the examples:

    dontrun: Everything inside \dontrun{} is not executed by the tests or example(). This is useful, e.g., for interactive functions, functions accessing the Internet etc.. Do not misuse it to make life easier for you by giving examples which cannot be executed.

提交回复
热议问题