Examples for 'base::deparse'


Expression Deparsing

Aliases: deparse deparse1

Keywords: programming manip data

### ** Examples

require(stats); require(graphics)

deparse(args(lm))
[1] "function (formula, data, subset, weights, na.action, method = \"qr\", " 
[2] "    model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, "
[3] "    contrasts = NULL, offset, ...) "                                    
[4] "NULL"                                                                   
deparse(args(lm), width.cutoff = 500)
[1] "function (formula, data, subset, weights, na.action, method = \"qr\", model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, contrasts = NULL, offset, ...) "
[2] "NULL"                                                                                                                                                                    
myplot <- function(x, y) {
    plot(x, y, xlab = deparse1(substitute(x)),
               ylab = deparse1(substitute(y)))
}

e <- quote(`foo bar`)
deparse(e)
[1] "foo bar"
deparse(e, backtick = TRUE)
[1] "`foo bar`"
e <- quote(`foo bar`+1)
deparse(e)
[1] "`foo bar` + 1"
deparse(e, control = "all") # wraps it w/ quote( . )
[1] "quote(`foo bar` + 1)"

[Package base version 4.2.3 Index]