mfdb_dplyr | R Documentation |
Use mfdb tables with dplyr
mfdb_dplyr_table(mdb, table_name, include_cols = all_cols) mfdb_dplyr_survey_index(mdb, include_cols = all_cols) mfdb_dplyr_division(mdb, include_cols = all_cols) mfdb_dplyr_sample(mdb, include_cols = all_cols) mfdb_dplyr_predator(mdb, include_cols = all_cols) mfdb_dplyr_prey(mdb, include_cols = all_cols)
mdb |
An object created by |
table_name |
A table name to query in |
include_cols |
Any additonal columns to include in output, see details. |
Warning: Whilst these might be handy for exploration, there is no guarantee that code using these will continue to work from one version of MFDB to the next.
There is one function for each measurement table. By default every possible
taxonomy column is included. However this is somewhat inefficient if you do
not require the data, in which case specify the columns requred with
include_cols
. See mfdb::mfdb_taxonomy_tables
for possible values.
To query taxonomy tables, use mfdb_dplyr_table
, which works for any supplied table name.
See mfdb::mfdb_taxonomy_tables
for possible values for table_name.
A dplyr table object, for you to do as you please.
mdb <- mfdb(tempfile(fileext = '.duckdb')) # Include as many columns as possible mfdb_dplyr_sample(mdb) # Only include 'data_source' and 'species' columns, as well as measurements mfdb_dplyr_sample(mdb, c('data_source', 'species')) # Query the sampling_type table mfdb_dplyr_table(mdb, 'sampling_type') mfdb_disconnect(mdb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.