Dienstag, 18. Mai 2010

Format

Tausender-Trennzeichen und Nachkommastellen
format( 1234, big.mark="'", nsmall=2 )
[1] "1'234.00"


leading zeros
sprintf("%04d", 15)
[1] "0015"

oder mit formatC:
formatC(1:5, width=2, flag="0")
[1] "01" "02" "03" "04" "05"


date
format( Sys.time(), "%Y-%m-%d %H:%M:%S" )
[1] "2010-05-19 10:31:57"

numers as hexnumbers
sprintf("%1$d %1$x %1$X", 0:255)

Codes unter R-Help: strptime 

Freitag, 7. Mai 2010

Von R zu Word

Control MS Word from R, do some reporting. The package RDCOMClient is great for that.
The library DescTools (available on CRAN) uses this package and contains some wrapping functions to make things easier.