dimnames.odbcDataset: Row and Column Names of an odbcDataset Object

Description Usage Arguments Value Author(s) See Also Examples

Description

dimnames returns the row and column names of an odbcDataset object; names returns the column names; rownames returns the row names.

Usage

1
2
3
4
5
6
## S3 method for class 'odbcDataset'
dimnames(x)
## S3 method for class 'odbcDataset'
names(x)
## S3 method for class 'odbcDataset'
row.names(x)

Arguments

x

an odbcDataset object.

Value

In the case of names, a character vector of column names; in the case of row.names, a character vector of row names; in the case of dimnames, a two-element list containing character vectors of row names and column names.

Author(s)

John Fox

See Also

odbcDataset, odbcDriverConnect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## These examples presuppose that the data set prestige is stored as a table
## in the database attached via odbcDriverConnect().
## This data set is supplied as the data frame Prestige in the dfdb.RODBC
## package.
## Depending upon your OS/DBMS, the call to odbcDriverConnect() may have
## to be modified.

## Not run: 
channel <- odbcDriverConnect()
            
sqlTables(channel)

Prestige <- odbcDataset(channel, "prestige")  # create a pseudo-dataframe
Prestige
names(Prestige)
row.names(Prestige)
dimnames(Prestige)
  
## End(Not run)

dfdb.RODBC documentation built on May 2, 2019, 5:18 p.m.