Selecting and ordering variables

William K. Morris

When requesting data using {finbif} you can select from among (or order by) many variables (properties of the occurrence records). The default set of variables returned is a small subset of those available. Note that not all variables are available for all records. See ?variables for details.

Selecting variables

Limiting variables

To retrieve a limited set of variables from FinBIF simply specify the desired variables in the select argument.

Click to show/hide output.

Extra variables

To get extra variables as well as the default set, specify the extra variables in addition to the keyword "default_vars".

Click to show/hide output.


You can change the order of occurrence records before they are fetched from the server by using the order_by argument. The default ordering is date_start descending, then load_date descending, then reported_name.

Ascending order

By default occurrence records are ordered by variables in ascending order.

Click to show/hide output.

Descending order

You can switch to descending order by prefixing the variable with a dash.

Click to show/hide output.

Multiple variables

You can specify multiple variables to order by. Sorting primacy is from left to right.

Click to show/hide output.

Random sample

You can also request a random sample (random order) of occurrence records by setting the sample argument to TRUE.

Click to show/hide output.