restoreObjects(sessionTools)
restoreObjects()所属R语言包:sessionTools
Restore Session Objects
恢复会话对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Restores the objects from an R binary file to the specified environment.
恢复对象从R二进制文件到指定的环境。
用法----------Usage----------
restoreObjects(file = "session.RData", envir = .GlobalEnv, clean = TRUE)
参数----------Arguments----------
参数:file
path to an R binary file
路径的R的二进制文件
参数:envir
the environment into which the objects should be restored.
应恢复到其中的对象的环境。
参数:clean
boolean indicating whether the environment should be purged prior to restoring objects
布尔值,指示的环境是否应清除之前恢复对象
值----------Value----------
This method is executed for it's side-effects.
执行该方法的副作用。
(作者)----------Author(s)----------
Matthew D. Furia <a href="mailto:matt.furia@sagebase.org">matt.furia@sagebase.org</a>
<a href="https://github.com/MattNapsAlot">https://github.com/MattNapsAlot</a>
实例----------Examples----------
## make some objects[#使一些对象。]
aMatrix <- diag(10)
letters <- c("a", "b", "c")
## save the session[#保存会话]
sessionFile <- tempfile(fileext=".rbin")
saveSession(list = ls(), file = sessionFile)
## create an environment where they can be restored[#创建一个环境,让他们可以恢复]
env <- new.env()
## assign an object[#分配一个对象。]
assign("goo", 1:10, envir = env)
## restore the objects leaving "goo"[#恢复的对象离开“咕”]
restoreObjects(file = sessionFile, envir = env, clean = FALSE)
ls(env)
## restore the objects again, this time delete all objects from env first[#恢复的对象了,这一次删除所有对象ENV第一]
restoreObjects(file = sessionFile, envir = env, clean = TRUE)
ls(env)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|