A DSD class that reads a data stream from an open DB result set from a relational database with using R's data base interface (DBI).
DSD_ReadDB(
result,
k = NA,
outofpoints = c("warn", "ignore", "stop"),
description = NULL
)# S3 method for DSD_ReadDB
close_stream(dsd, disconnect = TRUE, ...)
An object of class DSD_ReadDB
(subclass of DSD_R, DSD).
An open DBI result set.
Number of true clusters, if known.
Action taken if less than n
data points are
available. The default is to return the available data points with a warning. Other supported actions are:
warn
: return the available points (maybe an empty data.frame) with a warning.
ignore
: silently return the available points.
stop
: stop with an error.
a character string describing the data.
a stream.
logical; disconnect from the database?
further arguments.
Michael Hahsler
This class provides a streaming interface for result sets from a data base
with via DBI::DBI. You need to connect to the data base and submit a SQL
query using DBI::dbGetQuery()
to obtain a result set. Make sure that your
query only includes the columns that should be included in the stream
(including class and outlier marking columns).
Closing and resetting the stream
Do not forget to clear the
result set and disconnect from the data base connection.
close_stream()
clears the query result with DBI::dbClearResult()
and the disconnects from the database with DBI::dbDisconnect()
. Disconnecting
can be prevented by calling close_stream()
with disconnect = FALSE
.
reset_stream()
is not available for this type of stream.
Additional information
If additional information is available (e.g., class information), then the SQL
statement needs to make sure that the columns have the appropriate name starting with .
.
See Examples section below.
Other DSD:
DSD()
,
DSD_BarsAndGaussians()
,
DSD_Benchmark()
,
DSD_Cubes()
,
DSD_Gaussians()
,
DSD_MG()
,
DSD_Memory()
,
DSD_Mixture()
,
DSD_NULL()
,
DSD_ReadStream()
,
DSD_Target()
,
DSD_UniformNoise()
,
DSD_mlbenchData()
,
DSD_mlbenchGenerator()
,
DSF()
,
animate_data()
,
close_stream()
,
get_points()
,
plot.DSD()
,
reset_stream()