These methods are straight-forward implementations of the corresponding generic functions.
an object of class
the character string "PostgreSQL" or an
PostgreSQLConnection object as produced by
Name or the numeric IPaddress of the host to connect to. If address is specified, it should be in the standard IPv4 address format, e.g., 172.28.40.9 or if your machine supports IPv6, you can also use those addresses. The default is to connect to localhost by a UNIX domain socket.
The database name. Defaults to "", which is interpreted as PostgreSQL default.
PostgreSQL user name to connect as. Defaults to be the same as the operating system name of the user running the application.
Password to be used if the server demands password authentication.
Port number to connect to at the server host.
Ignored (formerly, this specified where to send server debug output).
Command-line options to be sent to the server.
logical if the communication of date (time stamp) from PostgreSQL is forced to ISO style at conection.
A connection between R/S-Plus and an PostgreSQL server is established. The current implementation supports up to 100 simultaneous connections.
See the Database Interface definition document
DBI.pdf in the base directory of this package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
## Not run: # create an PostgreSQL instance and create one connection. drv <- dbDriver("PostgreSQL") # open the connection using user, passsword, etc., as con <- dbConnect(drv, dbname = "postgres") df <- dbGetQuery(con, statement = paste( "SELECT itemCode, itemCost, itemProfit", "FROM sales", "SORT BY itemName")); # Run an SQL statement by creating first a resultSet object rs <- dbSendQuery(con, statement = paste( "SELECT itemCode, itemCost, itemProfit", "FROM sales", "SORT BY itemName")); # we now fetch records from the resultSet into a data.frame df <- fetch(rs, n = -1) # extract all rows dim(df) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.