monet.read.csv: monet.read.csv

Description Usage Arguments Value Examples

Description

Instruct MonetDB to read a CSV file, optionally also create the table for it. Note that this causes MonetDB to read a file on the machine where the server is running, not on the machine where the R client runs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
monet.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,
  ...
)

Arguments

conn

A MonetDB.R database connection, created using dbConnect with the MonetDB.R database driver.

files

A single string or a vector of strings containing the absolute file names of the CSV files to be imported.

tablename

The dataframe that needs to be stored in the table

header

Whether or not the CSV files contain a header line.

best.effort

Use best effort flag when reading csv files and continue importing even if parsing of fields/lines fails.

delim

Field separator in CSV file.

newline

Newline in CSV file, usually \n for UNIX-like systems and \r\r on Windows.

quote

Quote character(s) in CSV file.

create

Create table before importing?

col.names

Optional column names in case the ones from CSV file should not be used

lower.case.names

Convert all column names to lowercase in the database?

sep

alias for delim

Value

Returns the number of rows imported if successful.

Examples

1
2
3
4
5
library(DBI)
conn <- dbConnect(MonetDB.R::MonetDB(), dbname = "demo")
file <- tempfile()
write.table(iris, file, sep=",", row.names=F)
MonetDB.R::monetdb.read.csv(conn, file, "iris")

MonetDB/MonetDB.R documentation built on Dec. 31, 2020, 3:18 p.m.