Skip to content

rbind() fails when appending tsibbles with yearmonth indices #256

@mbg-unsw

Description

@mbg-unsw

When I use rbind() to append two tsibbles with yearmonth indices, I get this error:

Error: `levels.yearmonth()` not supported.

e.g.

l1 <- tsibble(t=yearmonth("2020 Jan"), n=1, cat="a", index=t, key=cat)
l2 <- tsibble(t=yearmonth("2020 Jan"), n=1, cat="b", index=t, key=cat)
rbind(l1, l2)

The operation works as expected if the index is a plain date.

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux bullseye/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tsibble_0.9.4

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5        lubridate_1.7.9.2 assertthat_0.2.1  crayon_1.4.0     
 [5] dplyr_1.0.4       R6_2.5.0          DBI_1.1.1         lifecycle_0.2.0  
 [9] magrittr_2.0.1    pillar_1.4.7      rlang_0.4.10      rstudioapi_0.13  
[13] vctrs_0.3.6       generics_0.1.0    ellipsis_0.3.1    glue_1.4.2       
[17] purrr_0.3.4       anytime_0.3.9     compiler_4.0.4    pkgconfig_2.0.3  
[21] tidyselect_1.1.0  tibble_3.0.6     

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