How to set knitr chunk output width on a per chunk basis?

后端 未结 2 1444
夕颜
夕颜 2021-02-07 13:20

My question(s):

Does knitr have an option that allows one to set R\'s width option on a per chunk basis?

If not, is there a good

2条回答
  •  滥情空心
    2021-02-07 13:50

    This also answers my question. I am using Beamer and knitr to make overheads, and sometimes I make the output smaller (eg. to get an analysis of variance table in one piece without wrapping). For example, I have a default width of 50, but I can now do

    {\small 
    <>=
      summary(my.aov)
    @
    }
    

    and I get the P-values on the same lines as the sums of squares, yet the width is still 50 for subsequent chunks.

提交回复
热议问题