File: collapse.tbl_sql.Rd

package info (click to toggle)
r-cran-dbplyr 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,644 kB
  • sloc: sh: 13; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verb-compute.R
\name{collapse.tbl_sql}
\alias{collapse.tbl_sql}
\alias{compute.tbl_sql}
\alias{collect.tbl_sql}
\title{Compute results of a query}
\usage{
\method{collapse}{tbl_sql}(x, ...)

\method{compute}{tbl_sql}(
  x,
  name = NULL,
  temporary = TRUE,
  unique_indexes = list(),
  indexes = list(),
  analyze = TRUE,
  ...,
  cte = FALSE
)

\method{collect}{tbl_sql}(x, ..., n = Inf, warn_incomplete = TRUE, cte = FALSE)
}
\arguments{
\item{x}{A lazy data frame backed by a database query.}

\item{...}{other parameters passed to methods.}

\item{name}{Table name in remote database.}

\item{temporary}{Should the table be temporary (\code{TRUE}, the default) or
persistent (\code{FALSE})?}

\item{unique_indexes}{a list of character vectors. Each element of the list
will create a new unique index over the specified column(s). Duplicate rows
will result in failure.}

\item{indexes}{a list of character vectors. Each element of the list
will create a new index.}

\item{analyze}{if \code{TRUE} (the default), will automatically ANALYZE the
new table so that the query optimiser has useful information.}

\item{cte}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}
Use common table expressions in the generated SQL?}

\item{n}{Number of rows to fetch. Defaults to \code{Inf}, meaning all rows.}

\item{warn_incomplete}{Warn if \code{n} is less than the number of result rows?}
}
\description{
These are methods for the dplyr generics \code{\link[=collapse]{collapse()}}, \code{\link[=compute]{compute()}},
and \code{\link[=collect]{collect()}}. \code{collapse()} creates a subquery, \code{compute()} stores
the results in a remote table, and \code{collect()} executes the query and
downloads the data into R.
}
\examples{
library(dplyr, warn.conflicts = FALSE)

db <- memdb_frame(a = c(3, 4, 1, 2), b = c(5, 1, 2, NA))
db \%>\% filter(a <= 2) \%>\% collect()
}