Description Usage Arguments Value Author(s) See Also Examples
These functions provide convienient interfaces to functionality provided in external packages (currently only dplyr). See the vignette and below examples.
1 2 |
.data |
A |
.tables |
A character vector indicating the table(s) the specified columns refer to. |
.preserve |
Currently ignored. |
... |
For |
An object of class tbl_sqlite
.
Daniel Bottomly
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.