+#' \dontrun{
+#' # WER distances computations are a bit too long for CRAN (for now)
+#'
+#' # Random series around cos(x,2x,3x)/sin(x,2x,3x)
+#' x = seq(0,500,0.05)
+#' L = length(x) #10001
+#' ref_series = matrix( c(cos(x), cos(2*x), cos(3*x), sin(x), sin(2*x), sin(3*x)),
+#' byrows=TRUE, ncol=L )
+#' library(wmtsa)
+#' series = do.call( rbind, lapply( 1:6, function(i)
+#' do.call(rbind, wmtsa::wavBootstrap(ref_series[i,], n.realization=400)) ) )
+#' #dim(series) #c(2400,10001)
+#' medoids_ascii = claws(series_RData, K1=60, K2=6, wf="d8", nb_series_per_chunk=500)
+#'
+#' # Same example, from CSV file
+#' csv_file = "/tmp/epclust_series.csv"
+#' write.table(series, csv_file, sep=",", row.names=FALSE, col.names=FALSE)
+#' medoids_csv = claws(csv_file, K1=60, K2=6, wf="d8", nb_series_per_chunk=500)
+#'
+#' # Same example, from binary file
+#' bin_file = "/tmp/epclust_series.bin"
+#' nbytes = 8
+#' endian = "little"
+#' epclust::serialize(csv_file, bin_file, 500, nbytes, endian)
+#' getSeries = function(indices) getDataInFile(indices, bin_file, nbytes, endian)
+#' medoids_bin = claws(getSeries, K1=60, K2=6, wf="d8", nb_series_per_chunk=500)
+#' unlink(csv_file)
+#' unlink(bin_file)
+#'
+#' # Same example, from SQLite database
+#' library(DBI)
+#' series_db <- dbConnect(RSQLite::SQLite(), "file::memory:")
+#' # Prepare data.frame in DB-format
+#' n = nrow(series)
+#' formatted_series = data.frame(
+#' ID = rep(1:n,each=L),
+#' time = as.POSIXct(1800*(0:n),"GMT",origin="2001-01-01"),
+#' value
+
+
+
+
+#' TODO
+
+
+#' times_values = as.data.frame(series)
+#' dbWriteTable(series_db, "times_values", times_values)
+#' # NOTE: assume that DB internal data is not reorganized when computing coefficients
+#' indexToID_inDB <<- list()
+#' getSeries = function(indices) {
+#' con = dbConnect(drv = RSQLite::SQLite(), dbname = db_file)
+#' if (indices %in% indexToID_inDB)
+#' {
+#' df = dbGetQuery(con, paste(
+#' "SELECT value FROM times_values GROUP BY id OFFSET ",start,