cleanup(RMark)
cleanup()所属R语言包:RMark
Removes unused MARK output files
删除未使用的标记输出文件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Identifies all unused (orphaned) mark*.inp, .vcv, .res and .out and .tmp files in the working directory and removes them. The orphaned files are determined by examining all mark objects and lists of mark objects (created by collect.models) to create a list of files in use. All other files are treated as orphans to delete.
确定所有未使用的(孤立的)标记*。INP。VCV,水库和。出来。tmp文件的工作目录,并删除它们。孤立的文件是由检查所有的标记对象和标记对象的列表(由collect.models)来创建一个列表,在使用中的文件。所有其他文件都被视为孤儿删除。
用法----------Usage----------
cleanup(lx = NULL, ask = TRUE, prefix = "mark")
参数----------Arguments----------
参数:lx
listing of R objects; defaults to list of workspace from calling environment; if NULL it uses ls(envir=parent.frame())
R对象,默认的工作区调用环境;上市的,如果为NULL使用ls(ENVIR parent.frame()的)
参数:ask
if TRUE, prompt whether each file should be removed. Typically will be used with ask=FALSE but default of TRUE may avoid problems
如果为TRUE,提示每个文件是否应该被删除。通常将被用于要求= FALSE,但默认设置为TRUE可避免的问题
参数:prefix
prefix for filename if different than "mark"
不同的前缀的文件名,如果比“标志”
Details
详细信息----------Details----------
This function removes orphaned output files from MARK. This occurs when there are output files in the subdirectory that are not associated with a mark object in the current R session (.Rdata). For example, if you repeat an analysis or set of analyses and store them in the same object then the original set of output files would no longer be linked to an R object and would be orphaned.
此功能删除孤立的输出文件MARK。发生这种情况时有输出文件的子目录中是不相关的,在目前的R会话(RDATA)标记对象。例如,如果你重复分析或一组分析,并将它们存储在同一个对象,那么原来的一组输出文件将不再被链接到一个R对象,并会被孤立。
As an example, consider the mallard analysis. The first time you run the analysis script in an empty subdirectory it would create 9 sets of MARK output files (mark001.out,.vcv,.res,.inp to mark009.out,.vcv,.res,.inp) and each would be linked to one of the objects in nest.results. When the command AgePpnGrass=nest.results$AgePpnGrass was issued, both of those mark objects were linked to the same set of output files. Now if you were to repeat the above commands and re-run the models and stored the results into nest.results again, it would create files with prefixes 10 to 18. Because that would have replaced nest.results, none of the files numbered 1 to 9 would be linked to an object. cleanup(ask=FALSE) automatically removes those orphan files. If you delete all objects in the R session with the command rm(list=ls(all=TRUE)), then subsequently cleanup(ask=FALSE) will delete all MARK output files because all of them will be orphans. Output files can also become orphans if MARK finishes but for some reason R crashes or you forget to save your session before you exit R. Orphan output files can be re-linked to an R object without re-running MARK by re-running the mark function in R and specifing the filename argument to match the base portion of the orphaned output file (eg "mark067"). It will create all of the necessary R objects and then asks if you want to use the existing file. If you respond affirmatively it will link to the orphaned files.
作为一个例子,考虑mallard分析。第一次在一个空的子目录,运行分析脚本,这会造成的MARK输出文件(mark001.out,VCV,水库,。INP到mark009.out,。VCV,水库,INP)和9套每个将挂在nest.results的对象之一。当命令AgePpnGrass=nest.results$AgePpnGrass发出的这些mark对象链接到同一组的输出文件。现在,如果你重复上面的命令,然后重新运行的模型和存储的结果nest.results再次,它会创建文件的前缀10日至18。因为这将取代nest.results,没有文件编号从1到9将链接到对象。 cleanup(ask=FALSE)会自动删除那些孤儿的文件。如果您删除的R会话中的所有对象的命令rm(list=ls(all=TRUE)),然后随后cleanup(ask=FALSE)将删除所有MARK输出文件,因为所有的人都会成为孤儿。输出文件也可以成为孤儿,如果MARK完成,但由于某种原因,ŕ崩溃或你忘记保存你的会话,然后再退出R.的孤儿输出文件可以被重新连接到一个R对象不必重新运行MARK重新运行 mark函数在R和specifingfilename参数相匹配的孤立的输出文件(例如“mark067”)的基部。它会创建所有必要的R对象,然后询问您是否要使用现有的文件。如果你作出肯定,它会链接到孤立的文件。
值----------Value----------
None
无
(作者)----------Author(s)----------
Jeff Laake
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|