找回密码
 注册
查看: 261|回复: 0

R语言 sessionTools包 restoreS4Methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:31:48 | 显示全部楼层 |阅读模式
restoreS4Methods(sessionTools)
restoreS4Methods()所属R语言包:sessionTools

                                         Restore Session Class Definitions
                                         恢复会话类定义

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Restores the class definitions from an R binary file to the specified environment.
从R的二进制文件到指定的环境恢复的类定义。


用法----------Usage----------


restoreS4Methods(file = "session.RData", envir = .GlobalEnv, clean = TRUE, srcEnv)



参数----------Arguments----------

参数:file
path to an R binary file  
路径的R的二进制文件


参数:envir
the environment into which the class definitions should be restored.  
环境类的定义应该恢复。


参数:clean
boolean indicating whether the environment should be purged of existing class definitions prior to restoring  
布尔值,指示环境是否应被清除现有的类定义之前恢复


参数:srcEnv
environment from which to restore generics. if this argument is provided the "file" arguments is ignored.  
环境恢复仿制药。如果这种说法是“文件”参数将被忽略。


值----------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 methods[#做的一些方法。]
setGeneric("foo", def = function(bar) standardGeneric("foo"))
setMethod("foo", definition = function(bar) print(foo))

## save the session[#保存会话]
sessionFile <- tempfile(fileext=".rbin")
saveSession(list = ls(), file = sessionFile)

## create an environment where they can be restored[#创建一个环境,让他们可以恢复]
env <- new.env()

## restore the generic[#恢复的通用]
restoreS4Methods(file = sessionFile, envir = env)
getGenerics(env)
findMethods("foo", where=env)


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-20 23:29 , Processed in 0.024709 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表