Skip to contents

Saves any R object as .rds with a confirmation message.

Usage

save_rds(obj, filename, path)

Arguments

obj

Any R object.

filename

Character. Output filename (e.g., "model_fit.rds").

path

Character. Output directory.

Value

Character. Full path to saved file (invisible).

Examples

out <- save_rds(mtcars, "cars.rds", tempdir())
#> ✔ RDS saved: /tmp/Rtmp5ydOUY/cars.rds
identical(readRDS(out), mtcars)
#> [1] TRUE
unlink(out)