示例值
以下概述包含每种类型的示例值:
#>行数:1#>列数:23#>$逻辑<lgl>TRUE#>$integer<int>1#>$double<dbl>1.5美元#>$字符<chr>“A”#>$复杂<cpl>0+1i#>$raw<raw>01#>$list<list>1#>$`命名列表`<命名列表>1#>$系数<fct>A#>$ordered命令#>$日期<日期>2023-03-19#>$POSIXt<dttm>2023-03-19 10:23:09#>$difftime<drtn>1秒#>$hms<时间>00:00:01#>整数64美元<int64>100000000000#>$blob<blob>00#>$data.frame<df[,1]><数据.frame[1 x 1]>#>$tbl_df<tibble[,1]><tbl_df[1 x 1]>#>$AsIs<I<int>>1#>$未指定<???>纳#>$vctrs_list_of<list<int>>1#>$vctrs_vctr<vctrs_pc>1#>$quosures<quos><~1>
实施
列标题是通过调用柱::type_sum()
在柱上。这是一种S3方法可以重写,但大多数时候重写更有用vctrs::vec_ptype_abbr()
:
支柱:::类型sum.default
#>函数(x)
#> {
#>pillar_attr<-attr(x,“pillar”,精确=TRUE)
#>标签<-pillar_attr$label
#>if(!is.null(label)){
#>返回(I(标签))
#> }
#>if(是.object(x)|vec_is(x)){
#>返回(vec_ptype_abbr(x))
#> }
#>开关(类型(x),内置=,特殊=,闭合=“fn”,
#>环境=“env”,符号=if(is_missing(x)){
#>“缺少”
#>}其他{
#>“sym”(对称)
#>},类型(x))
#> }
#><字节码:0x139fbe8c8>
#><环境:名称空间:支柱>