-
Notifications
You must be signed in to change notification settings - Fork 285
/
Copy pathread_rds.Rd
58 lines (50 loc) · 1.71 KB
/
read_rds.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rds.R
\name{read_rds}
\alias{read_rds}
\alias{write_rds}
\title{Read/write RDS files.}
\usage{
read_rds(file, refhook = NULL)
write_rds(
x,
file,
compress = c("none", "gz", "bz2", "xz"),
version = 2,
refhook = NULL,
text = FALSE,
path = deprecated(),
...
)
}
\arguments{
\item{file}{The file path to read from/write to.}
\item{refhook}{A function to handle reference objects.}
\item{x}{R object to write to serialise.}
\item{compress}{Compression method to use: "none", "gz" ,"bz", or "xz".}
\item{version}{Serialization format version to be used. The default value is 2
as it's compatible for R versions prior to 3.5.0. See \code{\link[base:readRDS]{base::saveRDS()}}
for more details.}
\item{text}{If \code{TRUE} a text representation is used, otherwise a binary representation is used.}
\item{path}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use the \code{file} argument
instead.}
\item{...}{Additional arguments to connection function. For example, control
the space-time trade-off of different compression methods with
\code{compression}. See \code{\link[=connections]{connections()}} for more details.}
}
\value{
\code{write_rds()} returns \code{x}, invisibly.
}
\description{
Consistent wrapper around \code{\link[=saveRDS]{saveRDS()}} and \code{\link[=readRDS]{readRDS()}}.
\code{write_rds()} does not compress by default as space is generally cheaper
than time.
}
\examples{
temp <- tempfile()
write_rds(mtcars, temp)
read_rds(temp)
\dontrun{
write_rds(mtcars, "compressed_mtc.rds", "xz", compression = 9L)
}
}