mysan: Sanitizer function for xtable that converts scientific...

Description Usage Arguments Value Author(s) Examples

View source: R/mysan.R

Description

Sanitizer function for xtable that converts scientific notation to latex style

Usage

1
mysan(x)

Arguments

x

character or numeric vector

Value

sanitized character

Author(s)

Chris Wallace

Examples

1
2
3
4
5
6
7
8
p<-10^(-seq(1,10))
format.pval(p) # scientific notation
mysan(p) # latex style

library(xtable)
df <- data.frame(numeric=p,scientific=format.pval(p),p.san=mysan(p))
print(xtable(df)) # doesn't work
print(xtable(df), sanitize.text.function=mysan)  # looks nice!

chr1swallace/random-functions documentation built on Oct. 6, 2017, 11:50 a.m.