When not using all name-value pairs during add_row on empty tbl_df the column types are being changed to lgl.
example.empty.df <- structure(list(id = integer(0),
install_id = integer(0),
port = integer(0),
db_name = character(0),
complete_db = integer(0)),
.Names = c("id", "install_id", "port", "db_name", "complete_db"),
row.names = integer(0),
class = c("tbl_df", "tbl", "data.frame"))
example.empty.df
# A tibble: 0 × 5
# ... with 5 variables: id <int>, install_id <int>, port <int>, db_name <chr>, complete_db <int>
changed.classes <- example.empty.df %>% tibble::add_row(install_id = 5)
changed.classes
# A tibble: 1 × 5
id install_id port db_name complete_db
<lgl> <dbl> <lgl> <lgl> <lgl>
1 NA 5 NA NA NA
I expected the column classes to be retained.
When not using all name-value pairs during add_row on empty tbl_df the column types are being changed to lgl.
Example:
I expected the column classes to be retained.