Dear All,
Please have a look at the script at the end of the post.
I try to bind together two tibbles, 3 character columns each but I get an error message
library(dplyr)
iso2<-structure(list(code = c("AF", "AX", "AL", "DZ", "AS", "AD", "AO",
"AI", "AQ", "AG"), country = c("Afghanistan", "Aland Islands",
"Albania", "Algeria", "American Samoa", "Andorra", "Angola",
"Anguilla", "Antarctica", "Antigua and Barbuda"), extra = c("afghanistan",
"aland islands", "albania", "algeria", "american samoa", "andorra",
"angola", "anguilla", "antarctica", "antigua and barbuda")), spec = structure(list(
cols = list(code = structure(list(), class = c("collector_character",
"collector")), country = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"), row.names = c(NA,
-10L), class = c("spec_tbl_df", "tbl_df", "tbl", "data.frame"
))
iso2_extra <- tibble(code=c("EU27", "WL"), country=c( "EU27", "World"),
extra=c("world", "world"))
bind_rows(iso2, iso2_extra)
but the result is
Error: No common type for ..1
<spec_tbl_df<
code : character
country: character
extra : character
and
..2
<tbl_df<
code : character
country: character
extra : character
.
Runrlang::last_error()
to see where the error occurred.
I enclose my sessionInfo()
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.5.so
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.8.99.9002
loaded via a namespace (and not attached):
[1] fansi_0.4.1 crayon_1.3.4 assertthat_0.2.1 R6_2.4.1
[5] lifecycle_0.2.0 magrittr_1.5 pillar_1.4.3 rlang_0.4.5.9000
[9] cli_2.0.2 vctrs_0.2.99.9010 generics_0.0.2 ellipsis_0.3.0
[13] tools_3.6.3 glue_1.4.0 purrr_0.3.3 compiler_3.6.3
[17] pkgconfig_2.0.3 tidyselect_1.0.0 tibble_3.0.0
Once again, any help is appreciated. I should add that with the dplyr CRAN version this works.