leading.blanks: Add leading blanks.

Description Usage Arguments Value Author(s)

Description

Add leading blanks. This is to align data in Latex tables. Changed from: cc.width <- nchar(as.character(cc)) to: cc.width <- nchar(as.character(cc),type="width") Why? To avoid problems with NA's in dataframes in txtplot. Main purpose: to align data in Latex tables. The ignore.first parameters controls the first row (often a row with names). For example:

xx <- data.frame(sample(c(1,1055500,10),10,replace=T),sample(c("a","aba","sfgsdfgfhgd"),10,replace=T))

xx.LATEX <- create.latex.table(xx)

yy <- leading.blanks(xx.LATEX,"x")

yy write.table(yy,"xx.txt",sep=" ",dimnames.write = F)

Usage

1
leading.blanks(xx.LATEX,"x") See example in body of function.

Arguments

df

is dataframe

blank.char

is the character to be added

extra.char

is an extra character

min.width

is the minimum width

max.width

is the maximum width

ignore.first

is gives special treatment to first column

trace

equal to TRUE produces output during execution

Value

A vector with the rounded numbers.

Author(s)

Claus E. Andersen


claus-e-andersen/clanTools documentation built on Oct. 23, 2020, 7:59 a.m.