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 31 32 33 34 35 36 37 38 39 40 41 42
|
% $Id: dbApply-methods.Rd,v 0.1 2008/08/10 18:04:01 psk Exp $
\name{dbApply-methods}
\docType{methods}
\alias{dbApply-methods}
\alias{dbApply,PostgreSQLResult-method}
\title{Apply R/S-Plus functions to remote groups of DBMS rows (experimental)}
\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.
}
\section{Methods}{\describe{
\item{res}{a PostgreSQL result set (see \code{\link[DBI]{dbSendQuery}}).}
\item{...}{any additional arguments to be passed to \code{FUN}.}
}
}
\references{
See the Database Interface definition document
\code{DBI.pdf} in the base directory of this package
or
\url{https://cran.r-project.org/package=DBI}.
}
\seealso{
\code{\link{PostgreSQL}}
\code{\link{postgresqlDBApply}}
\code{\link[DBI]{dbSendQuery}}
\code{\link[DBI]{fetch}}
}
\examples{\dontrun{
## 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))
}
}
\keyword{programming}
\keyword{interface}
\keyword{database}
% vim: syntax=tex
|