I am trying to add a vector which I generated in R to a sqlite table as a new column. For this I wanted to use dplyr (I installed the most recent dev. version along with the dbplyr package according to this post here). What I tried:
library(dplyr)
library(DBI)
#creating initial database and table
dbcon <- dbConnect(RSQLite::SQLite(), "cars.db")
dbWriteTable(dbcon, name = "cars", value = cars)
cars_tbl <- dplyr::tbl(dbcon, "cars")
#new values which I want to add as a new column
new_values <- sample(c("A","B","C"), nrow(cars), replace = TRUE)
#attempt to add new values as column to the table in the database
cars_tbl %>% mutate(new_col = new_values) #not working
What is an easy way to achieve this (not necessarily with dplyr)?