From 1573f5efba99dbd4722cddd851f088dc2bc16fbe Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 28 Apr 2025 13:51:13 -0700 Subject: [PATCH 1/2] Always generate row names --- R/repr_matrix_df.r | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/repr_matrix_df.r b/R/repr_matrix_df.r index af8dcbe..b79d0f3 100644 --- a/R/repr_matrix_df.r +++ b/R/repr_matrix_df.r @@ -40,6 +40,9 @@ arr_partition <- function(a, rows, cols) { part_r <- partition(nrow(a), rows) part_c <- partition(ncol(a), cols) + if (is.null(rownames(a))) rownames(a) <- seq_len(nrow(a)) + if (is.null(colnames(a))) colnames(a) <- seq_len(ncol(a)) + # assign a list of parts that can be coerced to strings if (!is.null(part_r) && !is.null(part_c)) { structure(list( From 14422d170f2aea5012147c7795f4f33476f441ac Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 23 Jul 2025 09:18:29 -0700 Subject: [PATCH 2/2] ws --- R/repr_matrix_df.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/repr_matrix_df.r b/R/repr_matrix_df.r index 3cea359..13dcf7d 100644 --- a/R/repr_matrix_df.r +++ b/R/repr_matrix_df.r @@ -89,7 +89,7 @@ partition_from_parts.data.table <- function(a, part_r, part_c) { arr_partition <- function(a, rows, cols) { stopifnot(rows >= 2L, cols >= 2L) - + # create sequences of indices to bisect rows and columns part_r <- partition(nrow(a), rows) part_c <- partition(ncol(a), cols)