Open gravesee opened 6 years ago
After adding the column using ALTER TABLE
you can of course do something like
dbExecute(con, "UPDATE mtcars SET mpg_per_cyl=mpg/cyl")
. But if I understand you correctly that value is computed by R? So what you would like to do is to extend your table with an R-computed column?
Yes, precisely! I would like to do some computations in R and then either add or update a column using the R vector. I've seen examples that do this by using paste
to effectively update row by row, but the column-store nature of MonetDB seems better suited to this model. I hope there is an idiomatic way to accomplish this. This is a fairly common use case for my group where our data is larger than memory but not larger than HDD.
The stand-alone MonetDB version can already do this with R UDFs (see https://www.monetdb.org/content/embedded-r-monetdb). Does this help?
I would like to use monetDB lite as an alternative to SAS for my medium data problems. To that end I need to add new columns consisting of transformations of existing columns done in R. I have searched the internet and documentation for a solution to this and have not found an answer.
I would like to do something like this:
To update the new column I have tried using databinding, but it seems this only works for one value:
The documentation for dbSendUpdate has the only reference to placeholders in the
MonetDBLite
package I could find. I am a bit new to working with DBs so forgive me if I've overlooked something obvious. Does this capability already exist?