Description Usage Arguments Examples
This creates an interesting database using data from the Lahman baseball data source, provided by Sean Lahman at http://www.seanlahman.com/baseball-archive/statistics/, and made easily available in R through the Lahman package by Michael Friendly, Dennis Murphy and Martin Monkman. See the documentation for that package for documentation of the inidividual tables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | lahman_sqlite(path = NULL)
lahman_postgres(dbname = "lahman", ...)
lahman_mysql(dbname = "lahman", ...)
lahman_df()
lahman_dt()
copy_lahman(src, ...)
has_lahman(type, ...)
lahman_srcs(..., quiet = NULL)
|
... |
Other arguments passed to |
type |
src type. |
quiet |
if |
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Connect to a local sqlite database, if already created
if (has_lahman("sqlite")) {
lahman_sqlite()
batting <- tbl(lahman_sqlite(), "Batting")
batting
}
# Connect to a local postgres database with lahman database, if available
if (has_lahman("postgres")) {
lahman_postgres()
batting <- tbl(lahman_postgres(), "Batting")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.