dbApply-methods: Apply R/S-Plus functions to remote groups of DBMS rows...

Description Methods References See Also Examples

Description

Applies R/S-Plus functions to groups of remote DBMS rows without bringing an entire result set all at once. The result set is expected to be sorted by the grouping field.

Methods

res

a PostgreSQL result set (see dbSendQuery).

...

any additional arguments to be passed to FUN.

References

See the Database Interface definition document DBI.pdf in the base directory of this package or http://stat.bell-labs.com/RS-DBI.

See Also

PostgreSQL postgresqlDBApply dbSendQuery fetch

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
## compute quanitiles for each network agent
con <- dbConnect(PostgreSQL(), user="user", password="passwd",dbname="dbname")
rs <- dbSendQuery(con, 
             "select Agent, ip_addr, DATA from pseudo_data order by Agent")
out <- dbApply(rs, INDEX = "Agent", 
        FUN = function(x, grp) quantile(x$DATA, names=FALSE))

## End(Not run)


Search within the RPostgreSQL package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.