dc {cwhstring}R Documentation

Convert number for use in decimal dot centered table columns

Description

Replace "." in a number by "&" for LaTeX tables using column specification r@{.}l

Usage

  dc (x,d,ch="&")
  dcn(x,d,ch="&")

Arguments

x Numerical vector.
d Number of decimals after ".". d >= 1, will be forced internally.
ch Substitute "." by ch

Value

string representation of x suitable for table column centered on "."

Note

dc = dcn, except for x = integer .

dc uses frac, dcn uses sprintf.

Author(s)

Christian W. Hoffmann, christian.hoffmann@wsl.ch,
http://www.wsl.ch/staff/christian.hoffmann

Examples

  nn <- c(0, 1, 0.1, pi,2*pi,-30*pi)
  dc(nn,3)    # "0&0"     "1&0"     "0&100"   "3&142"   "6&283"   "-94&248"
  dcn(nn,3)   # "0&000"   "1&000"   "0&100"   "3&142"   "6&283"   "-94&248"

[Package cwhstring version 1.0.4 Index]