Skip to content

Commit

Permalink
tabularray: no complete rows if complete columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Nov 3, 2024
1 parent 7a23c88 commit d14c3a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/style_tabularray.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ setMethod(

idx <- rec$span != "" | rec$set != ""

# complete columns
# complete columns (first because of d-column)
cols <- unique(rec[idx & rec$complete_column, c("j", "set", "span"), drop = FALSE])
spec <- by(cols, list(cols$set, cols$span), function(k) {
sprintf("column{%s}={%s}{%s}", paste(k$j, collapse = ","), k$span, k$set)
Expand All @@ -174,7 +174,10 @@ setMethod(
}

# complete rows
rows <- unique(rec[idx & rec$complete_row, c("i", "set", "span"), drop = FALSE])
rows <- unique(rec[
idx & rec$complete_row & !rec$complete_column,
c("i", "set", "span"),
drop = FALSE])
spec <- by(rows, list(rows$set, rows$span), function(k) {
sprintf("row{%s}={%s}{%s}", paste(k$i, collapse = ","), k$span, k$set)
})
Expand Down

0 comments on commit d14c3a8

Please sign in to comment.