save_rds: save_rds

View source: R/save_rds.R

save_rdsR Documentation

save_rds

Description

Save rds

Usage

save_rds(
  object,
  filename = NULL,
  path = NULL,
  overwrite = FALSE,
  rm_object = FALSE,
  ...
)

Arguments

object

R object to serialize.

filename

Name of the file where the R object is saved (file extension must be .rds).

path

Path to where the R object is saved.

overwrite

If true, existing file is overwritten.

rm_object

If true, the object is removed form the environment.

...

Options passed to saveRDS.

Details

This function checks if the file aready exists before saving it. If the file aready exists and 'overwrite = FALSE' (default), the file is not saved. The filename and path is combined using 'file.path()'. See '?base::saveRDS()“ for more information

See Also

saveRDS

Examples

## Not run: 
set.seed(42)
x <- runif(n = 100)
save_rds(x, filename = "random_numbers.rds")

## End(Not run)


mhesselbarth/UtilityFunctions documentation built on April 8, 2024, 9:38 a.m.