% dplyr::bind_rows( dplyr::tribble( ~comp, ~val, "h", 100 ) ) result" /> % dplyr::bind_rows( dplyr::tribble( ~comp, ~val, "h", 100 ) ) result" /> % dplyr::bind_rows( dplyr::tribble( ~comp, ~val, "h", 100 ) ) result"/>

dplyr::bind_rows throws error 'error in vec_size' when binding tribbles

325 Views Asked by At

Binding two tribbles

library(tidyverse)


dplyr::tribble(
  ~comp, ~val,
  "g", 100
) %>% 
  dplyr::bind_rows(
    dplyr::tribble(
      ~comp, ~val,
      "h", 100
    )
  )

results in the following error

Error in `vec_size()`:
! `x` must be a vector, not an environment.

This is not a result of masking:

> tidyverse_conflicts()
── Conflicts ─────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()

with this sessionInfo()

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 25211)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

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

other attached packages:
 [1] lubridate_1.8.0      forcats_0.5.2        stringr_1.4.1        dplyr_1.0.99.9000   
 [5] purrr_0.9000.0.9000  readr_2.1.3          tidyr_1.2.1          tibble_3.1.8        
 [9] ggplot2_3.3.6        tidyverse_1.3.2.9000

loaded via a namespace (and not attached):
 [1] rstudioapi_0.14       magrittr_2.0.3        hms_1.1.2             tidyselect_1.1.2.9000
 [5] munsell_0.5.0         colorspace_2.0-3      R6_2.5.1              rlang_1.0.6          
 [9] fansi_1.0.3           tools_4.2.1           grid_4.2.1            gtable_0.3.1         
[13] utf8_1.2.2            cli_3.4.1             withr_2.5.0           ellipsis_0.3.2       
[17] lifecycle_1.0.2.9000  crayon_1.5.2          tzdb_0.3.0            vctrs_0.4.2.9000     
[21] glue_1.6.2            stringi_1.7.8         compiler_4.2.1        pillar_1.8.1.9000    
[25] generics_0.1.3        scales_1.2.1          pkgconfig_2.0.3      
0

There are 0 best solutions below