dput {base} | R Documentation |
Writes an ASCII text representation of an R object to a file or connection, or uses one to recreate the object.
dput(x, file = "") dget(file)
x |
an object. |
file |
either a character string naming a file or a
connection. "" indicates output to the console. |
dput
opens file
and deparses the object x
into
that file. The object name is not written (contrary to dump
).
If x
is a function the associated environment is stripped.
Hence scoping information can be lost.
Using dget
, the object can be recreated (with the limitations
mentioned above).
dput
will warn if fewer characters were written to a file than
expected, which may indicate a full or corrupt file system.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
## Write an ASCII version of mean to the file "foo" dput(mean, "foo") ## And read it back into 'bar' bar <- dget("foo") unlink("foo")