How to print (to paper) a nicely-formatted data frame

后端 未结 10 2039
深忆病人
深忆病人 2020-12-07 08:41

I\'d like to print nicely-formatted data frames to paper, ideally from within a script. (I am trying to collect data using an instrument and automatically process and print

10条回答
  •  既然无缘
    2020-12-07 09:02

    The printr package is a good option for printing data.frames, help pages, vignette listings, and dataset listings in knitr documents.

    From the documentation page:

    options(digits = 4)
    set.seed(123)
    x = matrix(rnorm(40), 5)
    dimnames(x) = list(NULL, head(LETTERS, ncol(x)))
    knitr::kable(x, digits = 2, caption = "A table produced by printr.")
    

提交回复
热议问题