Skip to contents

All functions

C_to_F()
Celsus to Fahrenheit conversion
F_to_C()
Fahrenheit to Celsius conversion
acre_to_hectare()
Convert area from Acres to hectares
api_request()
Send a request to the Directus API https://docs.directus.io/ https://directus.io/docs/api
bearing()
Bearing angle Calculate the angle between two geographic points relative to true north (clockwise)
check_categories()
Check category dictionary
check_column_names()
Check column names for a staged table.
check_dictionary()
Check dictionary metadata for a database table.
check_dups()
Subset a dataframe for rows that are duplicated across a set of columns.
check_fk_values()
Check foreign key values for a staged table.
check_table_contents()
Check table contents before import
check_treatment_years()
Check for mistakes in treatment components and years.
date_formats
Date formats
delete_rows()
Delete rows in a table based on their primary key value
expand_years()
Expand data frame by start and end years
ft_to_m()
Convert length from feet to meters
generate_directus_pat()
Create Directus Personal Access Token
get_column_dict_for_table()
Get column dictionary for a specified table As an alternative to subsetting.
get_db_info()
Fetch schema information from directus
get_db_table()
Fetch an entire table from Directus
get_table_from_req()
Download content from an API fetch request into a data frame
harmonize_harvest_dates()
Harmonize harvest dates
harmonize_planting_info()
Harmonize planting info Reshapes the planting info table based on specifications set by the user. To aid in merging with yield data.
harmonize_treatments()
Harmonize treatment components
harmonize_treatments_units()
Harmonize treatment and unit information
harmonize_yields()
Harmonize crop yields
harmonize_yields_planting_harvest()
Harmonize yield with planting and harvest dates.
harmonize_yields_planting_harvest_treatments()
Harmonize crop yields with planting, harvest, and treatment data.
harmonize_yields_treatments()
Harmonize yield data with experimental treatment data.
httr_dry_run()
API dry run
import_db_tables()
Bulk download database tables
import_dictionary_tables()
Import dictionary tables These do not require an API key.
is.ISOdate()
Check if dates are in ISO format.
is_integer()
Check if a number is an integer
kg_to_lb()
Convert weight from kg to lb.
lb_to_kg()
Convert weight from pounds to kg
list_treatments_by_management_practice()
List treatment components by management practice.
m_to_ft()
Convert length from meters to feet
make_collection_json()
Make a collection schema json object from data dictionary tables
make_field_json()
Convert column dictionary content into json-formatted field schema. This is for adding fields to existing collections. Once a collection exists, only one field can be added at a time with an API request.
make_relations_json()
Make relations json schema objects from data dictionary tables
make_row_insert_json()
Convert a dataframe or tibble to a json object suitable to insert rows (items) Basically just the jsonlite::toJSON function with options set to non-defaults for conventience
make_template_df()
Make a template data frame from a vector of column names
modify_rows()
Modify content in existing rows
order_rows_by_internal_fk()
Order rows based on an internal foreign key For use in uploading rows to database tables. This specifies a row order for uploading that avoids violating internal foreign key constraints within a table.
order_tables_by_fk()
Order tables by foreign key dependencies This is used for posting items to collections with foreign key constraints. This is to help determine the order of items to post to avoid foreign key violations. Tables with internal foreign keys should use order_rows_by_internal_fk
originFromLonLat()
Get origin XY coordinates from longitude and latitude points. Used to estimate georeferenced plot geometry from map dimensions and points selected from Google Earth imagery.
pg_to_directus_type()
Map data types from Postgresql to Directus schema
post_rows()
Add rows to a database table
post_rows_in_batches()
Post rows in batches
print_stringvec_as_commasep()
Print a character vector as a list of quoted strings separated by commas.
query_table_by_pk()
Fetch table contents by primary keys Function to query contents of a database table with a vector of primary key values. Useful for double-checking before running 'modify_rows' or 'delete_rows'. It could be useful for querying information across tables.
read_directus_pat()
Import Directus PAT This imports a Directus Personal Access Token from a file created by generate_directus_token. It also tests whether the token is valid.
set_default_token()
Set default API token
test_api_token()
Verify Directus API token Used within other functions to check for errors.
test_category_dict
Sample category dictionary
test_column_dict
Sample column dictionary
test_table_dict
Sample table dictionary
transform_geometry()
Shift and rotate a geometry object. To help translate plot layout information into spatial coordinates.
unitacre_to_unithectare()
Convert any unit per acre area to the same unit per hectare area