Ken*_*enM 169
Rda只是RData的简称.您可以像使用RData一样保存(),加载(),附加()等.
Rds存储单个 R对象.然而,除了这个简单的解释之外,与"标准"存储有几点不同.可能这个R-manual链接到readRDS()函数可以充分阐明这种区别.
所以,回答你的问题:
Ric*_*rta 141
除了@KenM的答案之外,另一个重要的区别是,在加载已保存的对象时,您可以分配Rds文件的内容.不是这样的Rda
> x <- 1:5
> save(x, file="x.Rda")
> saveRDS(x, file="x.Rds")
> rm(x)
## ASSIGN USING readRDS
> new_x1 <- readRDS("x.Rds")
> new_x1
[1] 1 2 3 4 5
## 'ASSIGN' USING load -- note the result
> new_x2 <- load("x.Rda")
loading in to <environment: R_GlobalEnv>
> new_x2
[1] "x"
# NOTE: `load()` simply returns the name of the objects loaded. Not the values.
> x
[1] 1 2 3 4 5
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
116035 次 |
| 最近记录: |