I want to bind rows from two different data frames where one data frame contains a column of hash values whereas the second data frame doesn’t contain this column.
library(tidyverse)
library(openssl)
df <- data.frame(x = sha3(letters[1:3], size = 512),
y = 1:3)
df2 <- data.frame(y = 4:6)
df |>
bind_rows(df2)
When trying to bind rows, I get the following error:
Error in `bind_rows()`:
! Can't combine `..1` <hash> and `..2` <vctrs:::common_class_fallback>.
Run `rlang::last_trace()` to see where the error occurred.
I somehow get where this is coming from, because the second data frame doesn’t contain the x-column. However, my expected/desired output would the that bind_rows would still work and just fill the x-column with NA
‘s for df2
.