Skip to content

Implict rows/cols>0 assumption in arr_parts_combine #141

@MichaelChirico

Description

@MichaelChirico
repr::repr_text(matrix(nrow = 0, ncol = 100))
# Warning message:
# In cbind(parts$left, ellip_h, parts$right, deparse.level = 0L) :
#   number of rows of result is not a multiple of vector length (arg 2)

Ditto

repr::repr_text(matrix(ncol = 0, nrow = 100))
# Warning message:
# In rbind(parts$upper, ellip_v, parts$lower, deparse.level = 0L) :
#   number of columns of result is not a multiple of vector length (arg 2)

The diagnosis is simple enough; here:

repr/R/repr_matrix_df.r

Lines 84 to 85 in 7f27d6a

rows = rbind(parts$upper, ellip_v, parts$lower, deparse.level = 0L),
cols = cbind(parts$left, ellip_h, parts$right, deparse.level = 0L),

rbind/cbind is combining 0-length input with length-1 input (ellip_v/ellip_h).

I'm not 100% sure the correct behavior/best fix, however.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions