Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

saveObject

Saves an object to a file or a connection


Description

Saves an object to a file or a connection.

Usage

## Default S3 method:
saveObject(object, file=NULL, path=NULL, format=c("auto", "xdr", "rds"), compress=TRUE,
  ..., safe=TRUE)

Arguments

object

The object to be saved.

file

A filename or connection where the object should be saved. If NULL, the filename will be the hash code of the object plus ".xdr".

path

Optional path, if file is a filename.

format

File format.

compress

If TRUE, the file is compressed to, otherwise not.

...

Other arguments accepted by save() in the base package.

safe

If TRUE and file is a file, then, in order to lower the risk for incomplete files, the object is first written to a temporary file, which is then renamed to the final name.

Value

Returns (invisibly) the pathname or the connection.

Author(s)

Henrik Bengtsson

See Also

loadObject() to load an object from file. digest for how hash codes are calculated from an object. See also saveRDS().


R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.