library(readr)
bad_df1 <- readr::read_csv("a,b\n1,2\n-,2", col_types = "nn")
#> Warning: 1 parsing failure.
#> row col expected actual file
#> 2 a a number - literal data
bad_df2 <- readr::read_csv("a,b\n1,2\n2,-", col_types = "nn")
#> Warning: 1 parsing failure.
#> row col expected actual file
#> 2 b a number - literal data
dplyr::bind_rows(
bad_df1,
bad_df2
)
#> Error: Can't combine `..1` <spec_tbl_df<
#> a: double
#> b: double
#> >> and `..2` <spec_tbl_df<
#> a: double
#> b: double
#> >>.
attr(bad_df1, "problems") <- NULL
attr(bad_df2, "problems") <- NULL
dplyr::bind_rows(
bad_df1,
bad_df2
)
#> # A tibble: 4 x 2
#> a b
#> * <dbl> <dbl>
#> 1 1 2
#> 2 NA 2
#> 3 1 2
#> 4 2 NA
Created on 2020-04-11 by the reprex package (v0.3.0)