Places header and footer text items in outer margin of page and splits the screen appropriately. Can also redraw header and footer.
screenPage(head = NULL, sub = NULL, foot = NULL,
date = FALSE, dateFormat = "%x", time = FALSE,
topLeft = character(0), topRight = character(0),
headFont = par("font.main"), subFont = par("font.sub"),
footFont = par("font"),
cex = 1.001, headCex = 1.5, subCex = 0.85,
footCex = 0.75, topLeftCex = 0.85, topRightCex = 0.85,
footAlign = 0,
leftMargin = 0, rightMargin = leftMargin,
topMargin = 0, bottomMargin = topMargin)
character string or strings to appear centered in the top outer margin
of the page. If length(head) > 1
, a multi-line main title results.
character string or strings to appear centered just under head
.
character string or strings to appear in the bottom outer margin of the page.
logical: if TRUE
, put the current date in the upper right corner of
the page.
strptime
-style format to use if date
is TRUE
.
The default formats dates like 11/30/2006. What is actually being
formatted is the value returned by Sys.time()
, so you can
also use time formats here. For example, setting
dateFormat = "%c"
will create a string like
"Thu 30 Nov 2006 02:49:45 PM EST".
logical: if TRUE
, put the current time in the upper right corner of
the page. If date
is also true, the time string will be on
the line below the date string.
character string or strings to appear at top left corner of the page
character string or strings to appear at top right corner of the page
font to use in writing the main title in head
. The default
uses whatever par("font.main") is set to.
font to use in writing the sub title in sub
. The default uses
whatever par("font.sub") is set to.
font to use in writing the footnotes in foot
. The default
uses whatever par("font") is set to.
number by which all of the other "cex" arguments are scaled.
number: Character Expansion Factor (cex) for the string(s) in
head
. The actual cex used will be cex * headCex
.
number: cex for the string(s) in sub
. The actual cex used will
be cex * subCex
.
number: cex for the string(s) in foot
. The actual cex used will
be cex * footCex
.
number: cex for the string(s) appearing in the top left corner
of the page. The actual cex used for these strings will be
cex * topLeftCex
.
number: cex for the string(s) appearing in the top right corner
of the page, including the time and date stamps.
The actual cex used for these strings will be cex * topRightCex
.
number: justification for the strings in foot
. 0
means left
justify, 1
means right justify, 0.5
means to center
the text. Other numbers are a corresponding distance between the
extremes.
left margin of page in inches.
right margin of page in inches. Default is same
as leftMargin
top margin of page in inches.
bottom margin of page in inches. Default is same
as topMargin
This function returns a list of all of its arguments, including default values for arguments that were not supplied. The return is invisible if a graphics device is active.
screenPage
first sets aside space for the margins specified by
topMargin
, bottomMargin
, leftMargin
and
rightMargin
. Then it figures out how much additional space is
needed for the top and bottom outer margin text elements, places them,
and then splits the screen in 3, with screen 3 being the middle part
of the page. The user is then free either to further subdivide screen
3 (using split.screen()
) or to use it as is.
On exit, screen 3 is the active screen.
# NOT RUN {
screenPage(head = "Chart 1", date = TRUE, foot = rep(" ", 4),
cex = 0.85, headCex = 1)
## then draw charts, possibly after further subdividing the screen
# }
Run the code above in your browser using DataLab