Skip to content

Unexpected warnings from %*% on dibble objects with mismatched dimnames #33

@UchidaMizuki

Description

@UchidaMizuki
library(dibble)
#> 
#> Attaching package: 'dibble'
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following objects are masked from 'package:base':
#> 
#>     apply, colnames, diag, diag<-, ifelse, ncol, nrow, pmax, pmin,
#>     rownames

mat_x <- matrix(1:9, 3, dimnames = list(axis1 = 1:3, wrong_axis2 = 1:3))
mat_y <- matrix(1:9, 3, dimnames = list(axis2 = 1:3, axis3 = 1:3))
ddf_x <- as_dibble(mat_x)
ddf_y <- as_dibble(mat_y)


ddf_x %*% ddf_y
#> Warning in dim_names_e1[size_dim_names_e1] <- new_dim_name: number of items to
#> replace is not a multiple of replacement length
#> Warning in dim_names_e2[1] <- new_dim_name: number of items to replace is not a
#> multiple of replacement length
#> # A dibble:   9
#> # Dimensions: axis1 [3], axis3 [3]
#>   axis1 axis3     .
#>   <chr> <chr> <dbl>
#> 1 1     1        30
#> 2 1     2        66
#> 3 1     3       102
#> 4 2     1        36
#> 5 2     2        81
#> 6 2     3       126
#> 7 3     1        42
#> 8 3     2        96
#> 9 3     3       150

Created on 2025-12-31 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions