[Feature Request] Pretty-print named vectors and matrices?
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- R
- Estrellas
- 729
- Forks
- 94
- Merge medio
- 5 d 32 min
- PR fusionados (30 d)
- 5
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de r-lib/cli
-
C function cli_progress_sleep() is used in an example but not documented.Posiblemente ocupada @shreyabyte la tomó hace 58 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
`pb_elapsed` should not show minutes & fractions of secondsPosiblemente ocupada @mcol la tomó hace 413 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
feat: add `.duration` and `.time_ago` inline stylesPosiblemente ocupada @jjjermiah la tomó hace 174 días. Abiertofeature
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
docs: provide llms.txtAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
add bootmlmAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
extendr/extendr.github.io#134 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nmfs-ost/stockplotr#416 ·
Los mantenedores suelen responder en 1 día
-
ragnar_find_links() does not include the root URL in its resultsPosiblemente ocupada @andrie la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100