How to show output in console when writing an RMarkdown notebook?

前端 未结 2 848
夕颜
夕颜 2021-02-02 10:08

I have a simple question, and I think I\'m just not looking in the right place, or RStudio is not acting as expected. I\'d like to know if there is an option to output t

2条回答
  •  孤城傲影
    2021-02-02 10:40

    From the official website (emphasis by me):

    By default, RStudio enables inline output (notebook mode) on all R Markdown documents, so you can interact with any R Markdown document as though it were a notebook. If you have a document with which you prefer to use the traditional console method of interaction, you can disable notebook mode by clicking the gear in the editor toolbar and choosing Chunk Output in Console.

    This sets the chunk_output_type option in the YAML front-matter of your R Markdown document to console:

    ---
    editor_options:
      chunk_output_type: console
    ---
    

    Adding those lines to the YAML front-matter without clicking any GUI option will of course lead to the same result.

提交回复
热议问题