RÓïÑÔÖÐÎÄÍø

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á
²é¿´: 766|»Ø¸´: 0

RÓïÑÔ½ô´ÕµØÏÔʾÈÎÒâR¶ÔÏóµÄ½á¹¹strOptions()º¯Êý-ÖÐÓ¢ÎĶÔÕÕ°ïÖúÎĵµ

[¸´ÖÆÁ´½Ó]
·¢±íÓÚ 2020-8-21 08:15:11 | ÏÔʾȫ²¿Â¥²ã |ÔĶÁģʽ
        RÓïÑÔ½ô´ÕµØÏÔʾÈÎÒâR¶ÔÏóµÄ½á¹¹strOptions()º¯Êý-ÖÐÓ¢ÎĶÔÕÕ°ïÖúÎĵµ

                                         By MicroRbt Martinez PhD

RÓïÑÔº¯ÊýÃû£ºstrOptions()
RÓïÑÔº¯Êý¹¦ÄÜ£º½ô´ÕµØÏÔʾÈÎÒâR¶ÔÏóµÄ½á¹¹
À´×Ô×ÊÔ´¿â£º»ù´¡¿â£¨RÓïÑÔ×Ô´ø£©
strOptions()º¯ÊýËùÊô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£¨ÔÚijÖ̶ֳÈÉÏΪ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"µÄvec.len×é¼þ£¨Çë²ÎÔÄoptions£©£¬Ä¬ÈÏΪ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-6-3 03:45 , Processed in 0.028313 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí