设为首页收藏本站获取积分奖励

R语言中文网

 找回密码
 立即注册
查看: 638|回复: 0

R语言紧凑地显示任意R对象的结构str()函数-中英文对照帮助文档

[复制链接]
发表于 2020-8-21 08:15:00 | 显示全部楼层 |阅读模式
        R语言紧凑地显示任意R对象的结构str()函数-中英文对照帮助文档

                                         By MicroRbt Martinez PhD

R语言函数名:str()
R语言函数功能:紧凑地显示任意R对象的结构
来自资源库:基础库(R语言自带)
str()函数所属R语言包:所在R包具体名称、包功能的中英文双语描述见正文后面'--所在R语言包信息--'部分。

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

Compactly display the internal structure of an R object, a diagnostic function and an alternative to summary (and to some extent, dput). Ideally, only one line for each basic structure is displayed. It is especially well suited to compactly display the (abbreviated) contents of (possibly nested) lists. The idea is to give reasonable output for any R object. It calls args for (non-primitive) function objects.
紧凑地显示R对象的内部结构,诊断功能以及summary(在某种程度上为dput)的替代方法。理想情况下,每个basic结构仅显示一行。它特别适合紧凑地显示(可能嵌套的)列表的(缩写)内容。这个想法是为任何R对象提供合理的输出。它为(非原始)功能对象调用args。

strOptions() is a convenience function for setting options(str = .), see the examples.
strOptions()是用于设置options(str = .)的便捷功能,请参见示例。


使用方法-----Usage-----

str(object, ...)
## S3 method for class 'data.frame' S3 method for class 'data.frame'
str(object, ...)
## Default S3 methodefault S3 method:
默认的S3方法:

str(object, max.level = NA,
vec.len  = strO$vec.len, digits.d = strO$digits.d,
nchar.max = 128, give.attr = TRUE,
drop.deparse.attr = strO$drop.deparse.attr,
give.head = TRUE, give.length = give.head,
width = getOption("width"), nest.lev = 0,
indent.str = paste(rep.int(" ", max(0, nest.lev + 1)),
collapse = ".."),
comp.str = "$ ", no.list = FALSE, envir = baseenv(),
strict.width = strO$strict.width,
formatNum = strO$formatNum, list.len = strO$list.len,
deparse.lines = strO$deparse.lines, ...)
strOptions(strict.width = "no", digits.d = 3, vec.len = 4,
list.len = 99, deparse.lines = NULL,
drop.deparse.attr = TRUE,
formatNum = function(x, ...)
format(x, trim = TRUE, drop0trailing = TRUE, ...))

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

参数object介绍: any R object about which you want to have some information.
您想要有关其任何信息的任何R对象。

参数max.level介绍: maximal level of nesting which is applied for displaying nested structures, e.g., a list containing sub lists. Default NA: Display all nesting levels.
用于显示嵌套结构(例如包含子列表的列表)的最大嵌套级别。默认值NA:显示所有嵌套级别。

参数vec.len介绍: numeric (>= 0) indicating how many first few elements are displayed of each vector. The number is multiplied by different factors (from .5 to 3) depending on the kind of vector. Defaults to the vec.len component of option "str" (see options) which defaults to 4.
数值(> = 0),指示每个向量显示多少个first few元素。该数字乘以不同的因子(从0.5到3),具体取决于矢量的种类。默认为选项"str"(请参阅options)的vec.len组件,默认为4。

参数digits.d介绍: number of digits for numerical components (as for print). Defaults to the digits.d component of option "str" which defaults to 3.
数字分量的位数(与print一样)。默认为选项"str"的digits.d组件,默认为3。

参数nchar.max介绍: maximal number of characters to show for character strings. Longer strings are truncated, see longch example below.
character字符串显示的最大
-----未完,待续-----,↓↓↓展开剩余72%↓↓↓
购买主题 前行需要您的支持,请赞助作者 【15 金钱】 就能浏览全部100%内容啦!(本贴一次赞助、永久可读)
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Archiver|R语言中文网    

GMT+8, 2024-5-20 20:47 , Processed in 0.043651 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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