
Last chance! 50% off unlimited learning
Sale ends in
Instruct MonetDB to read a CSV file, optionally also create the table for it.
monetdb.read.csv (conn, files, tablename, header=TRUE,
best.effort=FALSE, delim=",",
newline = "\n", quote = "\"", create=TRUE, col.names=NULL, lower.case.names=FALSE,
sep=delim, ...)
A single string or a vector of strings containing the absolute file names of the CSV files to be imported.
Name of the database table the CSV files should be imported in. Created if necessary.
Whether or not the CSV files contain a header line.
Use best effort flag when reading csv files and continue importing even if parsing of fields/lines fails.
Field separator in CSV file.
Newline in CSV file, usually \n for UNIX-like systems and \r\r on Windows.
Quote character(s) in CSV file.
Create table before importing?
Convert all column names to lowercase in the database?
Optional column names in case the ones from CSV file should not be used
alias for delim
Additional parameters. Currently not in use.
Returns the number of rows imported if successful.
dbWriteTable
in DBIConnection-class
# NOT RUN {
library(DBI)
# connect to MonetDB
conn <- dbConnect(MonetDB.R::MonetDB(), dbname = "demo")
# write test data to temporary CSV file
file <- tempfile()
write.table(iris, file, sep=",")
# create table and import CSV
MonetDB.R::monetdb.read.csv(conn, file, "iris")
# }
Run the code above in your browser using DataLab