txtplot: Make a Lattice graph of text and data

View source: R/txtplot-function.R

txtplotR Documentation

Make a Lattice graph of text and data

Description

This function can print text or dataframes on a separate graphsheet or on an excisting graph. The main idea behind the function is to add experimental or analytical details (=text) on separate 'graphs' in between the real graphs. When everything is exported to pdf or PowerPoint we both have explanations and graphs in the same document. At the same time, we can easily read the text in the script. Hence this function should facilitate improved documentation. This is kind of a simple way of literate programming.

Usage

txtplot("hello world")

Arguments

txt

is the text or the dataframe to be printed

cex

(printing formatting)

col

(printing formatting)

font

(printing formatting).

new:

If true, txtplot opens a new graphsheet for graphical output

start.position

is a list with the start (x,y) position and an optional lineno on the page. start.pos = list(0.5,0.5, 6) refers to the center of the page and that the current line number is 6. The line number is used for keeping track of when we need a new page. If start.pos==NULL, then we just use the defaults x.start.default and y.start.default.

maintain.start.pos:

If false, then start each new line at x=x.start.default otherwise start each new line at the orginal x-start.pos

new.line:

If true,a new line is added after txt. Alternatively, include a backslash-n in the text.

page.size:

number of lines before page break.

line.size:

number of characters on a given line before line break (with or without hyphen)

line.size.extra:

to promote that lines are broken where there is white space we allow for a more relaxed break of lines. txtplot tries to break lines when there are more characters than given by line.size. However, it does not break before it reached a blank space - in so far that blank space occurs before the number of character is in the line is larger than: line.size + line.size.extra.

head:

not implemented

foot:

not implemented

evaluate:

treat txt as commands, and execute these (has never been used).

adjust.table:

add leading blanks using create.latex.table with the pretty.func argument

table.lines:

a vector with line numbers where horizontal lines should be made. This only applies to when txt is a data.frame. 999 is the last line. table.lines = TRUE is equivalent to table.lines =c(1,2,999) table.lines = F gives no table lines. Note: The table lines are drawn using the lines-command and is therefore restricted to the x-y drawing panel (not the full 0-1 by 0-1 coordinate system). In comparison, the text is drawn using the mtext-command. Set trace=TRUE and a red box will show where table lines can be drawn. If table lines are requested

table.line.pos:

Fine control of where table lines should be placed.

col.sign:

the sign between coloumns (used by create.latex.table)

hyphen.sign:

the sign used by txtplot when it breaks lines.

char.width:

distance between the start of each character (the size of each character is set by cex).

line.height:

height of each line

box:

list(coordinates, col, lwd, lty) or logical. The coordinates should be provided in the same order as usr (i.e. as: c(x1,x2,y1,y2)).

char.groupA/B/C:

Some characters do not have the same reference point as others, and we need to move these somewhat. Each char.groupX is a list with three elements: a vector of characters, a number that specify the movements in the x and y directions (x.right and y.lift, respectively).

trace:

debugging information

x.start.default:

The default start x-position

y.start.default:

The default start y-position

vp:

The viewport that will be created for new pages.

Value

The current position is returned. This can be input on subsequent calls as start.pos.

Author(s)

Claus E. Andersen


claus-e-andersen/clanLattice documentation built on Oct. 14, 2023, 10:41 a.m.