[Feature Request] Pretty-print named vectors and matrices?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Start by locating the existing pretty_print_code() implementation and reviewing how it formats output. Compare it with the named-vector and named-matrix examples, then clarify the desired color treatment and formatting behavior; the work is done when agreed output and coverage for both cases are established.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
I'd like to please request a function similar to pretty_print_code() to allow the printing of named vectors.
For example, in this snippet
x<-seq(0.001, 0.020, by = 0.001)
names(x) <- paste0("idx", 1:20)
x
#> idx1 idx2 idx3 idx4 idx5 idx6 idx7 idx8 idx9 idx10 idx11 idx12 idx13
#> 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010 0.011 0.012 0.013
#> idx14 idx15 idx16 idx17 idx18 idx19 idx20
#> 0.014 0.015 0.016 0.017 0.018 0.019 0.020
Created on 2025-12-08 with reprex v2.1.1
I find it quite hard to separate the names of the vector from the vector values itself. A color coded way to differentiate the two would be greatly appreciated.
Edit:
While I'm at it, printing a named matrix would also be greatly appreciated.
Here's an example problem generated using Claude
# Create the matrix with random values
set.seed(123) # For reproducibility
mat <- matrix(rnorm(400, mean = 50, sd = 15), nrow = 20, ncol = 20)
# Create row names
row_names <- paste0("Row_", sprintf("%02d", 1:20))
# Create column names
col_names <- paste0("Col_", sprintf("%02d", 1:20))
# Assign names
rownames(mat) <- row_names
colnames(mat) <- col_names
# Display the matrix
print(mat)
- Ngôn ngữ chính
- R
- Star
- 729
- Fork
- 94
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của r-lib/cli
-
C function cli_progress_sleep() is used in an example but not documented.Có thể đã có người làm @shreyabyte đã nhận 67 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
`pb_elapsed` should not show minutes & fractions of secondsCó thể đã có người làm @mcol đã nhận 422 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
-
feat: add `.duration` and `.time_ago` inline stylesCó thể đã có người làm @jjjermiah đã nhận 183 ngày trước. Đang mởfeature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
philchalmers/mirt#287 ·
-
querySqlToAndromeda(appendToTable = TRUE) errors with "This ResultSet is closed" after appendingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
OHDSI/DatabaseConnector#346 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100