Learn R Programming

cwhmisc (version 2.0.1)

heading: Write a line of text with underlining and blank lines

Description

heading writes m blank lines, then text, underline with length(text) copies of ch then write n blank lines comm can be used as comment character

Usage

heading(text, comm = "", ch = "-", m = 1, n = 0)

Arguments

text
(one line) text string, if "": only m+n empty lines
comm
optional comment character written at start of text and of underline
ch
character used to underline text, if "": no underline
m
number of empty lines written before text
n
number of empty lines written after underlined text

Value

  • NULL

Examples

Run this code
#\#  "#|" means the left margin
heading("Very compact","","=",0,1)
#\#| 
heading("","=")  # one blank line only
#\#|
heading("standard")
#\#|
#\#|standard
#\#|--------
heading("Just a line, not really a heading","","",0,0)
#\#|Just a line, not really a heading

Run the code above in your browser using DataLab