object.size(utils)
object.size()所属R语言包:utils
Report the Space Allocated for an Object
报告为对象分配空间
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Provides an estimate of the memory that is being used to store an R object.
提供了一个正在使用的内存来存储一个R对象的估计。
用法----------Usage----------
object.size(x)
## S3 method for class 'object_size'
print(x, quote = FALSE, units = "b", ...)
参数----------Arguments----------
参数:x
An R object.
一个R对象。
参数:quote
logical, indicating whether or not the result should be printed with surrounding quotes.
逻辑,显示与否的结果,应与周边报价印刷。
参数:units
The units to be used in printing the size. Other allowed values are "Kb", "Mb", "Gb" and "auto" (see "Details"). As from R 2.14.0, "KB" etc are also accepted.
各单位要使用打印的大小。其他允许的值是"Kb","Mb","Gb"和"auto"(见“详细资料”)。 2.14.0从R"KB"等也是可以接受的。
参数:...
Arguments to be passed to or from other methods.
参数被传递到或从其他方法。
Details
详情----------Details----------
Exactly which parts of the memory allocation should be attributed to which object is not clear-cut. This function merely provides a rough indication: it should be reasonably accurate for atomic vectors, but does not detect if elements of a list are shared, for example. (Sharing amongst elements of a character vector is taken into account, but not that between character vectors in a single object.)
哪些内存分配的部分应归因于哪个对象是不明确的。这个功能只是提供了一个粗略的指示:它应该是合理的原子向量准确的,但如果没有检测到一个列表中的元素是共享的,例如。 (之间共享一个特征向量的元素考虑,但不是在一个单一的对象之间的特征向量。)
The calculation is of the size of the object, and excludes the space needed to store its name in the symbol table.
计算对象的大小,不包括其名称存储在符号表中所需的空间。
Associated space (e.g. the environment of a function and what the pointer in a EXTPTRSXP points to) is not included in the calculation.
在计算中不包括相关的空间(如环境功能和EXTPTRSXP点的指针)。
Object sizes are larger on 64-bit builds than 32-bit ones, but will very likely be the same on different platforms with the same word length and pointer size.
对象大小是64位版本比32位的大,但很可能会在不同的平台上用同一个词的长度和指针的大小相同。
units = "auto" in the print method chooses the largest units in which the result is one or more (before rounding). Values in kilobytes, megabytes or gigabytes are rounded to the nearest 0.1.
units = "auto"print方法选择的结果是一个或多个(四舍五入前)最大的单位。千字节,兆字节或千兆字节的值四舍五入的最接近的0.1。
值----------Value----------
An object of class "object_size" with a length-one double value, an estimate of the memory allocation attributable to the object in bytes.
一个类的对象"object_size"长度双重价值,估计占内存分配字节的对象。
参见----------See Also----------
Memory-limits for the design limitations on object size.
Memory-limits为设计对象的大小限制。
举例----------Examples----------
object.size(letters)
object.size(ls)
print(object.size(library), units = "auto")
## find the 10 largest objects in the base package[#在基础包的10个最大的对象。]
z <- sapply(ls("package:base"), function(x)
object.size(get(x, envir = baseenv())))
as.matrix(rev(sort(z))[1:10])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|