Learn R Programming

HelpersMG (version 3.6)

d: Write an ASCII Representation of an Object

Description

Writes an ASCII text representation of an R object. It can be used as a replacement of dput() for named vectors. The controls "keepNA", "keepInteger" and "showAttributes" are utilized for named vectors.

Usage

d(x, file = "", control = c("keepNA", "keepInteger", "showAttributes"),
  collapse = ", \n  ")

Arguments

x

A named vector object

file

either a character string naming a file or a connection. "" indicates output to the console.

control

character vector indicating deparsing options. See .deparseOpts for their description.

collapse

Characters used to separate values.

Value

A string

Details

d Write an ASCII Representation of an Object

See Also

Other Characters: asc, chr, tnirp

Examples

Run this code
# NOT RUN {
d(c(A=10, B=20))
dput(c(A=10, B=20))
# }

Run the code above in your browser using DataLab