File: memdb_frame.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 (45 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/memdb.R
\name{memdb_frame}
\alias{memdb_frame}
\alias{tbl_memdb}
\alias{src_memdb}
\title{Create a database table in temporary in-memory database.}
\usage{
memdb_frame(..., .name = unique_table_name())

tbl_memdb(df, name = deparse(substitute(df)))

src_memdb()
}
\arguments{
\item{...}{<\code{\link[rlang:dyn-dots]{dynamic-dots}}>
A set of name-value pairs. These arguments are
processed with \code{\link[rlang:defusing-advanced]{rlang::quos()}} and support unquote via \code{\link{!!}} and
unquote-splice via \code{\link{!!!}}. Use \verb{:=} to create columns that start with a dot.

Arguments are evaluated sequentially.
You can refer to previously created elements directly or using the \link{.data}
pronoun.
To refer explicitly to objects in the calling environment, use \code{\link{!!}} or
\link{.env}, e.g. \code{!!.data} or \code{.env$.data} for the special case of an object
named \code{.data}.}

\item{df}{Data frame to copy}

\item{name, .name}{Name of table in database: defaults to a random name that's
unlikely to conflict with an existing table.}
}
\description{
\code{memdb_frame()} works like \code{\link[tibble:tibble]{tibble::tibble()}}, but instead of creating a new
data frame in R, it creates a table in \code{\link[=src_memdb]{src_memdb()}}.
}
\examples{
library(dplyr)
df <- memdb_frame(x = runif(100), y = runif(100))
df \%>\% arrange(x)
df \%>\% arrange(x) \%>\% show_query()

mtcars_db <- tbl_memdb(mtcars)
mtcars_db \%>\% group_by(cyl) \%>\% summarise(n = n()) \%>\% show_query()
}