external_funcs: Specific methods for generics defined in external packages.

Description Usage Arguments Value Author(s) See Also Examples

Description

These functions provide convienient interfaces to functionality provided in external packages (currently only dplyr). See the vignette and below examples.

Usage

1
2
filter(.data, ..., .preserve = FALSE)
select(.data, ...,.tables=NULL)

Arguments

.data

A Database object.

.tables

A character vector indicating the table(s) the specified columns refer to.

.preserve

Currently ignored.

...

For filter, a single valid R expression which would result in a logical vector upon execution. For select, expression indicating the columns to choose from the given table(s). See the examples in dplyr::filter and dplyr::select. In addition, the names of the tables can be prepended to each variable name similar to SQL statements (e.g. 'table.column').

Value

An object of class tbl_sqlite.

Author(s)

Daniel Bottomly

See Also

filter,select

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  if (require(Lahman))
  {
      baseball.teams <- makeSchemaFromData(TeamsFranchises, name="team_franch")
      baseball.teams <- append(baseball.teams, makeSchemaFromData(Teams, name="teams"))
      
      relationship(baseball.teams, from="team_franch", to="teams") <- franchID ~ franchID
      
      baseball.db <- Database(baseball.teams, tempfile())
      
      populate(baseball.db, teams=Teams, team_franch=TeamsFranchises)
      
      select(baseball.db, .tables="teams")
      
      select(baseball.db, .tables=c("teams", "team_franch"))
      
      select(baseball.db, yearID:WCWin, franchName)
      
      filter(baseball.db, active == "Y")
      
      select(filter(baseball.db, active == "Y" & W > 50 & teamID == "CAL"), active, W, teamID)
  }

dbottomly/poplite documentation built on May 15, 2019, 1:23 a.m.