Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horizontal separators between active and supplementary elements in printed tbl_ords #70

Open
corybrunson opened this issue Dec 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@corybrunson
Copy link
Owner

While the format() method (the workhorse of print()) for the tbl_ord class vertically separates artificial coordinates and annotations, it does not separate the active elements in the first few rows from the supplementary elements below them; see the example below. It would be helpful, in cases where elements of multiple types end up being printed, to distinguish the active from the supplemental. This might require an additional printed line of em-dashes, for example, or it might be done using a long underscore. (I would prefer not to rely on color-coding.)

library(ordr)
#> Loading required package: ggplot2
ordinate(
  x = LifeCycleSavings[, c("pop15", "pop75")],
  y = LifeCycleSavings[, c("sr", "dpi", "ddpi")],
  model = cancor_ord, scores = TRUE
)
#> # A tbl_ord of class 'cancor_ord': (54 x 2) x (56 x 2)'
#> # 2 coordinates: CanCor1 and CanCor2
#> # 
#> # Rows (standard): [ 54 x 2 | 3 ]
#>    CanCor1 CanCor2 |   name      center .element
#>                    |   <chr>      <dbl> <chr>   
#> 1 -0.00911 -0.0362 | 1 pop15      35.1  active  
#> 2  0.0486  -0.260  | 2 pop75       2.29 active  
#> 3  0.0804   0.0577 | 3 Australia  NA    score   
#> 4  0.210   -0.125  | 4 Austria    NA    score   
#> 5  0.207   -0.147  | 5 Belgium    NA    score   
#> # ℹ 49 more rows
#> # 
#> # Columns (standard): [ 56 x 2 | 3 ]
#>    CanCor1    CanCor2 |   name       center .element
#>                       |   <chr>       <dbl> <chr>   
#> 1 0.00847   0.0334    | 1 sr           9.67 active  
#> 2 0.000131 -0.0000759 | 2 dpi       1107.   active  
#> 3 0.00417  -0.0123    | 3 ddpi         3.76 active  
#> 4 0.171    -0.0232    | 4 Australia   NA    score   
#> 5 0.0735    0.0475    | 5 Austria     NA    score   
#> # ℹ 51 more rows

Created on 2024-12-30 with reprex v2.1.1

@corybrunson corybrunson added the enhancement New feature or request label Dec 30, 2024
@corybrunson
Copy link
Owner Author

Refer to this {tibble} vignette to systematically rewrite the 'tbl_ord' formatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant