utilities: SQLiteDataset Utilities

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Utility functions for RSQLiteDataset object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
col.classes(dataset, ...)
## S3 method for class 'SQLiteDataset'
col.classes(dataset, ...)
col.names(dataset, ...)
## S3 method for class 'SQLiteDataset'
col.names(dataset, ...) 
connection(dataset, ...)
## S3 method for class 'SQLiteDataset'
connection(dataset, ...)
database(dataset, ...)
## S3 method for class 'SQLiteDataset'
database(dataset, ...)
## S3 method for class 'SQLiteDataset'
dim(x)
## S3 method for class 'SQLiteDataset'
dimnames(x)
## S3 method for class 'SQLiteDataset'
names(x)
row.name(dataset, ...)
## S3 method for class 'SQLiteDataset'
row.name(dataset, ...)
## S3 method for class 'SQLiteDataset'
row.names(x)
table.name(dataset, ...)
## S3 method for class 'SQLiteDataset'
table.name(dataset, ...)
## S3 method for class 'SQLiteDataset'
with(data, expr, rows,  ...)
## S3 method for class 'SQLiteDataset'
within(data, expr, rows,  ...)

Arguments

data, dataset, x

SQLiteDataset object.

expr

a possibly multiline R expression to evaluate within the environment constructed from the data set.

rows

an optional quoted SQL query defining the rows to retrieve; if missing, all rows are retrieved.

...

ignored.

Details

Most of these functions report information about a SQLiteDataset object, and are self-explanatory. The within method can be used to add variables to the database table.

Value

Varies with the function.

Author(s)

John Fox, jfor@mcmaster.ca.

See Also

SQLiteDataset, dim, dimnames, names, rownames, with, within

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
dr <- dbDriver("SQLite")
tfile <- tempfile()
con <- dbConnect(dr, dbname = tfile)
dbWriteTable(con, "USArrests", USArrests)
dbDisconnect(con)
Arrests <- SQLiteDataset("USArrests", database=tfile)
col.classes(Arrests)
col.names(Arrests)
connection(Arrests)
dim(Arrests)
dimnames(Arrests)
names(Arrests)
row.name(Arrests)
row.names(Arrests)
table.name(Arrests)
with(Arrests, mean(Rape))
with(Arrests, mean(Rape), rows="Murder > 10")
within(Arrests, logMurder <- log(Murder))
with(Arrests, mean(logMurder))
close(Arrests)

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

Related to utilities in dfdb...