R deparse Function


deparse() function turns unevaluated expressions into character strings.

deparse(expr, width.cutoff = 60L,
backtick = mode(expr) %in%
c("call", "expression", "(", "function"),
control = c("keepInteger", "showAttributes", "keepNA"),
nlines = -1L)


expr: R expression
with.cutoff: integer in [20, 500] determining the cutoff (in bytes) at which line-breaking is tried
backtick: logical indicating whether symbolic names should be enclosed in backticks if they do not follow the standard syntax
control: character vector of deparsing options
nlines: integer: the maximum number of lines to produce. Negative values indicate no limit
...

> 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=20)

[1] "function (formula, data, " " subset, weights, "
[3] " na.action, method = \"qr\", " " model = TRUE, x = FALSE, "
[5] " y = FALSE, qr = TRUE, " " singular.ok = TRUE, "
[7] " contrasts = NULL, " " offset, ...) "
[9] "NULL"



endmemo.com © 2024  | Terms of Use | Privacy | Home