View source: R/assignAndSaveData.R
assignAndSaveData | R Documentation |
Assigns a new object by name to the current working environment then saves
the newly assigned object, specified by the "dir"
argument.
assignAndSaveData(
name,
object,
dir = getOption(x = "acid.save.dir", default = getwd()),
ext = getOption(x = "acid.save.ext", default = "rds"),
overwrite = getOption(x = "acid.overwrite", default = TRUE),
compress = getOption(x = "acid.save.compress", default = TRUE),
envir = parent.frame()
)
name |
|
object |
Object. |
dir |
|
ext |
Supported arguments:
RDS is preferred when saving single objects per file, which is always the
convention of |
overwrite |
|
compress |
|
envir |
|
Invisible named character(1)
.
File path.
This function attempts to follow the same order as assign()
.
Updated 2022-06-02.
x <- 1L
dir <- AcidBase::tempdir2()
assignAndSaveData(
name = "example",
object = x,
dir = dir,
ext = "rds"
)
exists("example", inherits = FALSE)
file.exists(file.path(dir, "example.rds"))
AcidBase::unlink2(dir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.