Building a dataset or compilation

Functions that can be used when building individual datasets and entire compilation.

build_setup_pipeline()

Update the remake.yml file with new studies

build_add_version()

Add version information to a database

build_post_process()

Run a database repository's post-build step

build_post_export()

Run a database repository's export step

build_export()

Write a built database to export/data/curr

dataset_update_taxonomy()

Apply taxonomic updates to a processed dataset

data_update_taxonomy()

Apply taxonomic updates to a processed dataset

dataset_build()

Build dataset

dataset_configure()

Configure AusTraits database object

dataset_process()

Load Dataset

dataset_report()

Build reports for listed datasets

get_schema()

Load schema for an traits.build data compilation (excluding traits)

get_unit_conversions()

Make unit conversion functions

util_get_SHA()

Get SHA string from Github repository for latest commit

util_get_version()

Retrieve version for compilation from definitions

Depositing a release

Functions that deposit a release of a database on Zenodo.

zenodo_metadata()

Zenodo deposit metadata for a database release

zenodo_compare()

Compare a Zenodo version's metadata with the previous version's

zenodo_deposit()

Deposit a database release on Zenodo as a draft

Creating metadata files

Functions that help you create metadata files.

dataset_test()

Test whether specified dataset_id has the correct setup

dataset_find_pivot_duplicates()

Find the rows that stop a dataset pivoting wider

metadata_create_template()

Create a template of file metadata.yml for specified dataset_id

metadata_check_custom_R_code()

Check the output of running custom_R_code specified in the metadata for specified dataset_id

metadata_add_traits()

For specified dataset_id, populate columns for traits into metadata

metadata_add_contexts()

For specified dataset_id import context data from a dataframe

metadata_add_locations()

For specified dataset_id import location data from a dataframe

metadata_add_source_bibtex()

Adds citation details to a metadata file for given study

metadata_add_source_doi()

Adds citation details from a doi to a metadata file for a dataset_id

metadata_convert_sources()

Convert the source: blocks of metadata.yml files to the current shape

metadata_add_substitution()

Add a categorical trait value substitution into a metadata file for a dataset_id

metadata_add_substitutions_list()

Add a dataframe of trait value substitutions into a metadata file for a dataset_id

metadata_add_substitutions_table()

Substitutions from a dataframe

metadata_add_taxonomic_change()

Add a taxonomic change into the metadata.yml file for a dataset_id

metadata_add_taxonomic_changes_list()

Add a list of taxonomic updates into a metadata file for a dataset_id

metadata_find_taxonomic_change()

Find dataset_id's with a given taxonomic change

metadata_remove_taxonomic_change()

Remove a taxonomic change from a yaml file for a dataset_id

metadata_update_taxonomic_change()

Update a taxonomic change into a yaml file for a dataset_id

metadata_exclude_observations()

Exclude observations in a yaml file for a dataset_id

metadata_dewrap_fields()

Collapse hard-wrapped line breaks in a metadata.yml field

dataset_replace_disallowed_chars()

Replace disallowed characters in a dataset's files

metadata_add_identifiers()

For specified dataset_id import database cross-referencing identifer data from a dataframe

dataset_find_taxon()

Find list of unique datasets within compilation containing specified taxa

Writing custom R code

Functions for a dataset’s custom_R_code, which reshapes data.csv before it is processed.

move_values_to_new_trait()

Move values of one trait into another trait's column

move_values_to_new_trait_long()

Move values of one trait to another trait, for data in long format

util_parse_collection_date()

Standardise a messy collection_date (or raw date) column

util_format_collection_date()

Convert collection_date values from a declared format to the standard one

Reading & writing files

Enable reading and writing of various file types.

read_csv_char()

Read in a csv as a tibble with column types as characters

read_metadata()

Read in a metadata.yml file for a study

write_metadata()

Write metadata.yml for a study

read_yaml

Read yaml (from package yaml)

write_yaml

write yaml (from package yaml)

write_plaintext()

Export a database as plain text

Working with outputs

Functions to work with compiled traits.build objects.

check_pivot_duplicates()

Identify duplicates preventing pivoting wider

dataset_check_duplicate_values()

Find values that may duplicate data already in another dataset

dataset_check_outlier_by_species()

Find numeric values far from what other datasets report for the same species

dataset_check_outlier_by_genus()

Find numeric values far from what other datasets report for the same genus

dataset_check_duplicates_within_dataset()

Find taxa whose values for a trait are all the same within a dataset

dataset_check_categorical_substitutions()

List the categorical values a dataset needs substitutions for

dataset_new_taxa_trait_combinations()

New taxa added by a dataset

check_pivot_wider()

Test whether a dataset can pivot wider

database_create_combined_table()

Create a single combined table from a database

Building a compilation (private)

Private functions that are called in the background when building individual datasets and entire compilation. These are only of interest to developers.

process_add_all_columns()

Add or remove columns of data

process_convert_units()

Convert units to desired type

process_create_observation_id()

Create entity id

process_custom_code()

Apply custom data manipulations

process_flag_excluded_observations()

Flag any excluded observations

process_flag_out_of_range_values()

Flag values outside of allowable range

process_flag_unsupported_characters()

Flag values with unsupported characters

process_flag_unsupported_traits()

Flag any unrecognised traits

process_flag_unsupported_values()

Flag disallowed trait values and disallowed characters

process_format_contexts()

Format context data from list to tibble

process_format_contributors()

Format contributors from list into tibble

process_format_locations()

Format location data as a tibble

process_format_identifiers()

Format identifiers from list into tibble

process_generate_id()

Function to generate sequence of integer ids from vector of names Determines number of 00s needed based on number of records

process_generate_method_ids()

Function to generate sequence of integer ids for methods

process_parse_data()

Process a single dataset

process_standardise_names()

Standardise species names

process_taxonomic_updates()

Apply taxonomic updates

process_unit_conversion_name()

Generate unit conversion name

dataset_test_worker()

Test whether specified dataset_id has the correct setup

metadata_path_dataset_id()

Path to the metadata.yml file for specified dataset_id

metadata_user_select_column()

Select column by user

metadata_user_select_names()

Select variable names by user

read_metadata_dataset()

Read the metadata.yml file for specified dataset_id

write_metadata_dataset()

Write the YAML representation of metadata.yml for specified dataset_id to file data/dataset_id/metadata.yml

Diverse utility functions

Diverse utility functions for converting and working with various data types.

util_append_to_list()

Add an item to the end of a list

bib_print()

Format BibEntry using RefManageR

util_bib_to_list()

Convert BibEntry object to a list

util_check_all_values_in()

Check values in one vector against values in another vector

util_check_disallowed_chars()

Check values in a vector do not contain disallowed characters

util_df_convert_character()

Convert all columns in data frame to character

util_extract_list_element()

Extract a trait element from the definitions$traits$elements

util_extract_synonyms()

Extract the synonyms declared in a trait value's description

util_flatten_sources()

Flatten the source block of a metadata.yml into one row per reference

util_kable_styling_html()

Format table with kable and default styling for html

util_list_to_bib()

Convert a list of elements into a BibEntry object

util_replace_null()

Convert NULL values to a different value

util_separate_and_sort()

Split and order cells with multiple values

util_standardise_doi()

Standardise doi

create_tree_branch()

Format a tree structure from a vector

Functions used when writing reports (private)

Private functions used inside the template reports. These are only of interest to developers.

notetaker_start()

Start note recorder (needs review?)

notetaker_add_note()

Add a note to the note recorder as a new row

notetaker_as_note()

Create a tibble with two columns with note and link

notetaker_get_note()

Return a specific row from notes

notetaker_print_all()

Print all notes

notetaker_print_note()

Print note (needs review?)

notetaker_print_notes()

Print a specific row from notes

notes_random_string()

Create a string of random letters

Deprecated function names

Functions that have been moved from traits.build to traits.use (formerly austraits) and renamed. Deprecated names still work.

build_combine()

Combine all the AusTraits studies into the compiled AusTraits database

util_df_to_list()

Convert dataframe to list

util_list_to_df1()

Convert a list with single entries to dataframe

util_list_to_df2()

Convert a list of lists to dataframe