From f06be9c37faa0b31bd2373c34a5f69266ad9a2fd Mon Sep 17 00:00:00 2001 From: simularis <48603739+simularis@users.noreply.github.com> Date: Fri, 14 Feb 2020 11:11:13 -0700 Subject: [PATCH] More illustrative example of fill * Show default width from options * Show that long strings are not broken until fill width is reached --- printing.Rmd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/printing.Rmd b/printing.Rmd index 2dd558c..a48351b 100644 --- a/printing.Rmd +++ b/printing.Rmd @@ -152,12 +152,16 @@ cat(month.name[1:4], sep = "") ``` The argument `fill` allows us to break long strings; this is achieved when we -specify the string width with an integer number: +specify the string width with an integer number (or the default set by options()): ```{r cat_ex5} -# fill = 30 +options(width=79) +print(options('width')) cat("Loooooooooong strings", "can be displayed", "in a nice format", - "by using the 'fill' argument", fill = 30) + "by using the 'fill' argument", fill = T) +# fill = 40 +cat("Loooooooooong strings", "can be displayed", "in a nice format", + "by using the 'fill' argument", fill = 40) ``` Last but not least, we can specify a file output in `cat()`. For instance,