R/plot.R

Defines functions Sigcode plotwith

## generate sigcode
Sigcode <- function(x){
    res <- cut(x,
        breaks = c(0, 0.001, 0.01, 0.05, 1),
        labels = c('***', '**', '*', ''),
        include.lowest = TRUE)
    as.character(res)
}

# draw a base R figure with different graphic parameters and restore afterwards
plotwith <- function(expr = {}, ...){
    op <- par(..., no.readonly = TRUE)
    eval(expr, envir = parent.frame())
    par(op)
}
mt1022/Rutils documentation built on May 25, 2019, 10:34 p.m.