Skip to content

Need to use type = "width" with nchar in trunc_mat #100

@hadley

Description

@hadley

Otherwise fullwidth character column names are not aligned correctly:

library(tibble)
x <- c("成交日期", "合同录入日期")
setNames(data_frame(1:3, 4:6), x)
#> Source: local data frame [3 x 2]
#> 
#>   成交日期 合同录入日期
#>      <int>        <int>
#> 1        1            4
#> 2        2            5
#> 3        3            6
nchar(x)
#> [1] 4 6
nchar(x, type = "width")
#> [1]  8 12

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions