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

R语言:summaryRprof()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-17 10:04:09 | 显示全部楼层 |阅读模式
summaryRprof(utils)
summaryRprof()所属R语言包:utils

                                        Summarise Output of R Sampling Profiler
                                         R的采样分析器的信息Summarise输出。

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

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

Summarise the output of the Rprof function to show the amount of time used by different R functions.
信息SummariseRprof函数的输出,显示不同的R函数所用的时间量。


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


summaryRprof(filename = "Rprof.out", chunksize = 5000,
              memory=c("none","both","tseries","stats"),
              index=2, diff=TRUE, exclude=NULL)



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

参数:filename
Name of a file produced by Rprof()
名称Rprof()产生一个文件


参数:chunksize
Number of lines to read at a time
一次读取的行数


参数:memory
Summaries for memory information.  See "Details" below
内存信息摘要。请参阅下面的“详细信息”。


参数:index
How to summarize the stack trace for memory information.  See "Details" below.
如何总结的记忆信息的堆栈跟踪。请参阅下面的“详细资料”。


参数:diff
If TRUE memory summaries use change in memory rather than current memory
如果TRUE内存摘要变化,而不是当前的内存使用内存


参数:exclude
Functions to exclude when summarizing the stack trace for memory summaries
功能,以排除内存摘要总结堆栈跟踪时


Details

详情----------Details----------

This function provides the analysis code for Rprof files used by R CMD Rprof.
此功能提供RprofR CMD Rprof使用的文件的分析代码。

As the profiling output file could be larger than available memory, it is read in blocks of chunksize lines.  Increasing chunksize will make the function run faster if sufficient memory is available.
作为分析输出文件可能大于可用内存,它是只读chunksize线块。增加chunksize将函数的运行速度更快,如果有足够的内存可用。

When called with memory.profiling = TRUE, the profiler writes information on three aspects of memory use: vector memory in small blocks on the R heap, vector memory in large blocks (from malloc), memory in nodes on the R heap.  It also records the number of calls to the internal function duplicate in the time interval.  duplicate is called by C code when arguments need to be copied.  Note that the profiler does not track which function actually allocated the memory.
时,与memory.profiling = TRUE称为分析器写入内存使用三个方面的信息:矢量内存小的R堆,矢量大块内存块(从malloc),记忆中的R上的节点堆。它也记录呼叫次数的内部功能的时间间隔duplicate。 duplicate被称为C代码,当参数需要被复制。请注意,探查不跟踪哪个函数分配的内存。

With memory = "both" the change in total memory (truncated at zero) is reported in addition to timing data.
与memory = "both"据悉除了定时数据中的总内存(零截断)的变化。

With memory = "tseries" or memory = "stats" the index argument specifies how to summarize the stack trace.  A positive number specifies that many calls from the bottom of the stack; a negative number specifies the number of calls from the top of the stack.  With memory = "tseries" the index is used to construct labels and may be a vector to give multiple sets of labels.  With memory = "stats" the index must be a single number and specifies how to aggregate the data to the maximum and average of the memory statistics.  With both memory = "tseries" and memory = "stats" the argument diff = TRUE asks for summaries of the increase in memory use over the sampling interval and diff = FALSE asks for the memory use at the end of the interval.
memory = "tseries"或memory = "stats"index参数指定如何总结堆栈跟踪。正数指定从堆栈的底部,许多电话;负数指定的调用堆栈的顶部。与memory = "tseries"该指数是用来兴建标签,可能是一个向量给多套标签。用memory = "stats"索引必须是单数,并指定如何汇总数据的内存统计信息的最大和平均。既memory = "tseries"和memory = "stats"要求增加内存使用过的采样间隔和摘要的说法diff = TRUEdiff = FALSE要求在间隔结束的内存使用。


值----------Value----------

If memory = "none", a list with components
如果memory = "none",一个组件的列表


参数:by.self
Timings sorted by "self" time
自我时间排序计时


参数:by.total
Timings sorted by "total" time
“总的时间排序计时


参数:sample.interval
The sampling interval
采样间隔


参数:sampling.time
Total length of profiling run
分析运行的总长度

If memory = "both" the same list but with memory consumption in Mb in addition to the timings.  
如果memory = "both"相同的列表,但除了计时消费MB内存。

If memory = "tseries" a data frame giving memory statistics over time
如果memory = "tseries"让记忆随着时间的推移统计数据框

If memory = "stats" a by object giving memory statistics by function.
如果memory = "stats"by对象,给予内存统计功能。


参见----------See Also----------

The chapter on “Tidying and profiling R code” in “Writing R Extensions” (see the "doc/manual" subdirectory of the R source tree).
章“整理和分析R代码”中的“写R扩展”(见doc/manual的R源代码树的子目录)。

Rprof
Rprof

tracemem traces copying of an object via the C function duplicate.
tracemem跟踪对象的复制,通过C函数duplicate。

Rprofmem is a non-sampling memory-use profiler.
Rprofmem是一个非抽样内存使用Profiler。

http://developer.r-project.org/memory-profiling.html



举例----------Examples----------


## Not run: [#无法运行:]
## Rprof() is not available on all platforms[在所有平台上不可用#Rprof()]
Rprof(tmp <- tempfile())
example(glm)
Rprof()
summaryRprof(tmp)
unlink(tmp)

## End(Not run)[#结束(不运行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 00:01 , Processed in 0.023035 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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