coercion: Coerce SQLiteDataset Objects to Other Classes

Description Usage Arguments Value Author(s) See Also Examples

Description

Methods to coercise a SQLiteDataset object to a data frame, list, or matrix.

Usage

1
2
3
4
5
6
## S3 method for class 'SQLiteDataset'
as.data.frame(x, row.names, optional, ...)
## S3 method for class 'SQLiteDataset'
as.list(x, ...)
## S3 method for class 'SQLiteDataset'
as.matrix(x, ...)

Arguments

x

an SQLiteDataset object.

row.names

not used.

optional

not used.

...

not used.

Value

a data frame, list, or matrix containing the entire data set.

Author(s)

John Fox, jfor@mcmaster.ca.

See Also

SQLiteDataset, as.data.frame, as.list, as.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dr <- dbDriver("SQLite")
tfile <- tempfile()
con <- dbConnect(dr, dbname = tfile)
dbWriteTable(con, "USArrests", USArrests)
dbDisconnect(con)
Arrests <- SQLiteDataset("USArrests", database=tfile)
as.data.frame(Arrests)
as.list(Arrests)
as.matrix(Arrests)
close(Arrests)

dfdb documentation built on May 2, 2019, 4:58 p.m.

Related to coercion in dfdb...