Skip to contents

Database Connections

Connect to and manage PostgreSQL database connections

call.mydb()
Get primary database connection (wrapper)
call.mydb.taxa()
Get taxa database connection (wrapper)
connect_database()
Connect to database
create_pool_main()
Create a connection pool for Shiny apps (main database)
create_pool_taxa()
Create a connection pool for Shiny apps (taxa database)
cleanup_connections()
Cleanup all database connections
db_diagnostic()
Complete database diagnostic
print_connection_status()
Print connection status
get_connection_info()
Get connection information
test_connection()
Test database connection
setup_db_credentials()
Setup credentials storage in environment variables
remove_db_credentials()
Remove stored credentials
create_db_config()
Create local DB config file
func_try_fetch()
Safely execute a SQL query with automatic retry
try_open_postgres_table()
Try to open PostgreSQL table
get_database_fk()
Get database foreign keys

Data Queries

Query plots, individuals, taxa, traits, and specimens from the database

query_plots()
Query plots from database
query_subplots()
Legacy function - wrapper for backward compatibility
query_plot_features()
Query subplot features with improved architecture
query_individual_features()
Query individual features with improved architecture
get_individual_aggregated_features()
Aggregate individual features to individual level
query_taxa()
List, extract taxa
query_taxa_traits()
Query traits at the taxonomic level
query_trait()
Query in taxa trait table
query_traits_measures()
Legacy function - wrapper for backward compatibility
query_traits_measures_features()
Query features associated with trait measurements
query_colnam()
Query in colnam table
query_specimens()
Query Specimens
query_all_specimen_links()
Query All Specimen Links for Individuals
query_citations()
Query citations from table_citations
species_plot_matrix()
Get species-plot data frame
explore_allometric_taxa()
Explore allometric relation
list_individual_features()
List all available individual features
get_linktypes()
Get Link Types from Lookup Table
method_list()
List of method
country_list()
List of countries
subplot_list()
List all available subplot types
traits_list()
List of trait and features potentially liked to individual
traits_taxa_list()
List of trait
PlotFetcher
Fetch plot data
PlotFilterBuilder
Query builder for plot
SpecimenFetcher
Specimen Fetcher
SpecimenFilterBuilder
Specimen Filter Builder
get_user_accessible_plots()
Get plot IDs accessible to a user
match_tax()
Query and standardize taxonomy
match_taxonomic_names()
Match taxonomic names to backbone with intelligent SQL-side strategy
resolve_taxon_synonyms()
Resolve taxonomic synonyms
get_taxon_hierarchy()
Get Full Taxonomy Hierarchy for a Taxon
get_taxon_ancestors()
Get All Ancestors of a Taxon
get_taxon_children()
Get All Children of a Taxon
count_taxon_children()
Count Children at Each Level
get_updates_diconame()
Get backups of modified taxonomic data
get_primary_specimen_link()
Get Primary Specimen for Individuals
get_ref_specimen_ind()
Find Unlinked Individuals with Herbarium Information

Data Adding

Add new plots, individuals, traits, specimens, and taxa to the database

add_plots()
Add new plot metadata
add_individuals()
Add new individuals data
add_plot_features()
Add Plot Features to Existing Plots
add_subplot_features()
Add an observation in subplot_features table
add_subplot_observations_feat()
Add subplot observations features
add_plot_coordinates()
Add 1ha IRd plot coordinates
add_specimens()
Add new specimens data
add_citation()
Add one or more citations to table_citations
add_entry_taxa()
Add new entry to taxonomic table
add_growth_form_taxa()
Add growth forms to a single taxa
add_person_to_db()
Add a person to table_colnam using secure function
add_method()
Add a method in method list
add_sp_traits_measures()
Add an observation in trait measurement table at species level
add_trait()
Add trait
add_trait_taxa()
Add a trait in species trait list
add_traits_measures()
Add an observation in trait measurement table
add_taxa_table_taxa()
Add formatted taxa information
add_subplottype()
Add a type in subplot table
import_plot_metadata()
Import Plot Metadata with Transaction Support
import_individual_data()
Import Individual Data with Transaction Support

Update and Delete

Update existing records and safely delete data with cascade handling

update_records()
Update records with optional single-record comparison display
update_dico_name()
Update taxonomic data
update_dico_name_batch()
Update diconame data based on id of taxa
update_ident_specimens()
Update specimens table
update_link_specimens_batch()
Update plot data data
update_specimens_batch()
Update specimens data data
update_taxa_link_table()
Update table_idtax (Materialized View Version)
update_taxon_parent()
Update Taxon Parent (with consistency check)
update_citation()
Update fields of an existing citation
apply_citation_backfill()
Apply citation backfill from a manually filled data frame
safe_delete_individuals()
Safely delete individual(s) with all related data
safe_delete_plot()
Safely delete plot(s) with all related data
safe_delete_taxa_traits()
Safely delete taxa trait measurements with all related data
safe_delete_individual_features()
Safely delete individual feature measurements with all related data
safe_delete_specimen_links()
Safely delete individual-specimen links
.delete_country()
Delete an entry in country table
.delete_individual_feature_type()
Delete an entry in individual feature table
.delete_specimens()
Delete an entry in specimen table
detect_direct_changes()
Detect changes in direct columns with visual display

Internal Linking & Matching Utilities

Advanced internal functions for data matching and linking

.add_link_specimens()
Add Link Between Specimen and Individual
.add_modif_field()
Query fuzzy match
.add_taxa_noninteractive()
Add taxonomic entry non-interactively (for Shiny apps)
.comp_print_vec()
Compare two row-tibbles and generate HTML with differences
.delete_colnam()
Delete an entry in colnam table
.delete_trait_list()
Delete an entry in trait list
.find_cat()
Internal function
.find_ids()
Internal function
.find_similar_string()
Internal function
.get_trait_individuals_values()
Legacy function - wrapper for backward compatibility
.link_sp_trait()
Internal function
.link_subplotype()
Internal function
.link_table()
Internal function
.link_trait()
Internal function
.pairwise_string_similarity()
Internal function
.query_unmatched_specimens()
Query Unmatched Specimens (Internal)
.rename_data()
Internal function

Data Processing

Process, validate, transform, and aggregate inventory and trait data

compute_growth()
Compute growth rates for permanent plots
compute_mortality()
Compute mortality and recruitment rates
compute_stem_vital_status()
Compute stem vital status for specified individuals
process_trimble_data()
Process trimble data
process_individuals()
Process individuals for query_plots
process_stems()
Process multiple stems
divid_plot()
Divid into quadrats a 1ha plot
extract_corners()
Extract all corners of 1ha plot
approximate_isolated_xy()
Interpolate x y position based on neighnour
proj_rel_xy()
Project stems in geographical space
latlong2UTM()
Get UTM from geographical coordinates
get_plot_rel_xy()
Project stems in geographical space
pivot_categorical_traits_generic()
Pivot categorical trait data to wide format
pivot_numeric_traits_generic()
Pivot numeric trait data to wide format with statistics
summarize_feature()
Get summary statistics for a specific feature
merge_individuals_taxa()
Merge individual records with taxonomic information
replace_NA()
Replace or restore missing values in a data frame
clean_taxonomic_name()
Clean and normalize taxonomic name
parse_taxonomic_name()
Parse taxonomic name into components
standardize_taxonomic_batch()
Standardize taxonomic names in a data frame
validate_plot_metadata()
Validate Plot Metadata Before Import
validate_individual_data()
Validate Individual Data Before Import
map_individual_columns()
Map Individual Data Columns
map_user_columns()
Map User Columns to Database Schema
get_import_column_routing()
Get Import Column Routing Configuration
enrich_traits_with_measurement_features()
Enrich trait data with measurement features (generic)
enrich_with_traits()
Enrich individuals with all traits
print_validation_results()
Print Validation Results
print_individual_validation_results()
Print Individual Validation Results
print_import_result()
Print Import Result
print_template_info()
Print Template Column Information
print_individual_template_info()
Export Individual Template Info
print_mapping_summary()
Print Mapping Summary
get_individual_template()
Generate Individual Data Import Template
get_plot_metadata_template()
Get Plot Metadata Template
export_plot_template()
Export Plot Metadata Template to Excel
describe_columns()
Describe columns in query results
choose_growth_form()
Choose growth forms
choose_prompt()
Choose from prompt
test.order.subplot()
Check the order of subplots in a given data frame
export_taxa_traits_for_citation_backfill()
Export taxa trait measurements for citation backfill
print(<column_documentation>)
Print method for column_documentation objects
print(<plot_features_result>)
Print method for add_plot_features result
print(<plot_query_list>)
Print method for plot_query_list
print(<plot_validation_result>)
Print method for validation results
print_table()
print table as html in viewer

Shiny Apps

Launch interactive Shiny applications for data management and exploration

launch_import_wizard()
Launch Import Wizard Shiny App
launch_feature_wizard()
Launch Feature Wizard Shiny App
launch_query_plots_app()
Launch Query Plots Interactive App
launch_individual_specimen_linking_app()
Launch Individual-Specimen Linking App
launch_specimen_import_wizard()
Launch Specimen Import Wizard
launch_taxa_traits_import()
Launch Taxa Traits Import App
launch_taxo_backbone_app()
Launch Taxonomic Backbone Management App
launch_taxonomic_match_app()
Launch Taxonomic Name Standardization App
shiny_app_query_plots()
Query Plots Shiny App
shiny_app_taxo_backbone()
Taxonomic Backbone Management Shiny App
mod_database_login_ui()
Database Login Module - UI
mod_database_login_server()
Database Login Module - Server

Shiny Module Components

Internal Shiny UI and server module components

mod_census_information_server()
Census Information Module - Server
mod_census_information_ui()
Census Information Module - UI
mod_code_preview_server()
Code Preview Module - Server
mod_code_preview_ui()
Code Preview Module - UI
mod_extraction_config_server()
Extraction Configuration Module - Server
mod_extraction_config_ui()
Extraction Configuration Module - UI
mod_feat_step1_select_plots_server()
Feature Wizard Step 1: Select Plots - Server
mod_feat_step1_select_plots_ui()
Feature Wizard Step 1: Select Plots - UI
mod_feat_step2_choose_mode_server()
Feature Wizard Step 2: Choose Mode - Server
mod_feat_step2_choose_mode_ui()
Feature Wizard Step 2: Choose Mode - UI
mod_feat_step3_measurements_server()
Feature Wizard Step 3: Individual Measurements - Server
mod_feat_step3_measurements_ui()
Feature Wizard Step 3: Individual Measurements - UI
mod_feat_step3_multi_stems_server()
Feature Wizard Step 3: Multi-Stems - Server
mod_feat_step3_multi_stems_ui()
Feature Wizard Step 3: Multi-Stems - UI
mod_feat_step3_plot_features_server()
Feature Wizard Step 3: Plot Features - Server
mod_feat_step3_plot_features_ui()
Feature Wizard Step 3: Plot Features - UI
mod_feat_step4_lookup_server()
Feature Wizard Step 4: Lookup Matching - Server
mod_feat_step4_lookup_ui()
Feature Wizard Step 4: Lookup Matching - UI
mod_feat_step5_validation_server()
Feature Wizard Step 5: Validation - Server
mod_feat_step5_validation_ui()
Feature Wizard Step 5: Validation - UI
mod_feat_step6_import_server()
Feature Wizard Step 6: Import - Server
mod_feat_step6_import_ui()
Feature Wizard Step 6: Import - UI
mod_growth_form_selector_server()
Growth Form Selector Module - Server
mod_growth_form_selector_ui()
Growth Form Selector Module - UI
mod_herbarium_parser_server()
Herbarium Parser Module - Server
mod_herbarium_parser_ui()
Herbarium Parser Module - UI
mod_individual_search_server()
Individual Search Module - Server
mod_individual_search_ui()
Individual Search Module - UI
mod_link_executor_server()
Link Executor Module - Server
mod_link_executor_ui()
Link Executor Module - UI
mod_link_preview_server()
Link Preview Module - Server
mod_link_preview_ui()
Link Preview Module - UI
mod_plot_filters_server()
Plot Filters Module - Server
mod_plot_filters_ui()
Plot Filters Module - UI
mod_plot_metadata_viewer_server()
Plot Metadata Viewer Module - Server
mod_plot_metadata_viewer_ui()
Plot Metadata Viewer Module - UI
mod_plot_statistics_server()
Plot Statistics Module - Server
mod_plot_statistics_ui()
Plot Statistics Module - UI
mod_results_display_server()
Results Display Module - Server
mod_results_display_ui()
Results Display Module - UI
mod_specimen_add_server()
Specimen Add Module - Server
mod_specimen_add_ui()
Specimen Add Module - UI
mod_specimen_import_server()
Specimen Import Module - Server
mod_specimen_import_ui()
Specimen Import Module - UI
mod_specimen_lookup_server()
Specimen Lookup Module - Server
mod_specimen_lookup_ui()
Specimen Lookup Module - UI
mod_specimen_mapping_server()
Specimen Mapping Module - Server
mod_specimen_mapping_ui()
Specimen Mapping Module - UI
mod_specimen_retriever_server()
Specimen Retriever Module - Server
mod_specimen_retriever_ui()
Specimen Retriever Module - UI
mod_specimen_search_server()
Specimen Search Module - Server
mod_specimen_search_ui()
Specimen Search Module - UI
mod_specimen_upload_server()
Specimen Upload Module - Server
mod_specimen_upload_ui()
Specimen Upload Module - UI
mod_taxa_add_server()
Taxa Add Module - Server
mod_taxa_add_ui()
Taxa Add Module - UI
mod_taxa_search_server()
Taxa Search & Browser Module - Server
mod_taxa_search_ui()
Taxa Search & Browser Module - UI
mod_taxa_synonymy_server()
Taxa Synonymy Module - Server
mod_taxa_synonymy_ui()
Taxa Synonymy Module - UI
mod_taxa_tree_view_server()
Taxa Tree View Module - Server
mod_taxa_tree_view_ui()
Taxa Tree View Module - UI
mod_taxa_update_server()
Taxa Update Module - Server
mod_taxa_update_ui()
Taxa Update Module - UI
mod_taxonomic_validator_server()
Taxonomic Validator Module - Server
mod_taxonomic_validator_ui()
Taxonomic Validator Module - UI
mod_trait_column_mapping_server()
Trait Column Mapping Module - Server
mod_trait_column_mapping_ui()
Trait Column Mapping Module - UI
mod_trait_metadata_mapping_server()
Trait Metadata Mapping Module - Server
mod_trait_metadata_mapping_ui()
Trait Metadata Mapping Module - UI
mod_trait_preview_import_server()
Trait Preview & Import Module - Server
mod_trait_preview_import_ui()
Trait Preview & Import Module - UI
mod_trait_validation_server()
Trait Validation Module - Server
mod_trait_validation_ui()
Trait Validation Module - UI
model_wd_2
model_wd_1
model_wd_2
model_wd_2
phylo_tree
phylo_tree

Internationalization

Translation and multi-language support utilities for Shiny apps

create_reactive_translator()
Create Reactive Translator
get_available_languages()
Get Available Translation Languages
init_translator()
Initialize Translator for Shiny App

Backbone Cache

Taxonomic backbone cache management for offline use

cache_exists()
Check if valid backbone cache exists
delete_backbone_cache()
Clear backbone cache
get_backbone_cache_path()
Get backbone cache directory path
get_cache_metadata()
Get cache metadata with formatted displays
load_backbone_cache()
Load backbone from cache with validation
save_backbone_cache()
Save backbone data to cache

Administration & Permissions

User management, database permissions, backup, and migration utilities

define_user_policy()
Define user policy for row-level security
define_read_only_policy()
Define read-only policy for a user
define_read_write_policy()
Define read-write policy for a user
define_full_access_policy()
Define full access policy for a user
setup_user_permissions()
Setup user permissions on both databases
setup_import_wizard_permissions()
Setup complete import wizard permissions
list_user_policies()
List user policies
register_user()
Register a user in the registry
deactivate_user()
Deactivate a user
reactivate_user()
Reactivate a user
list_database_users()
List all database users and their permissions
get_registered_users()
Get all registered users
get_user_emails()
Get email addresses of all registered users
create_user_registry()
Create user registry table
grant_all_table_permissions()
Grant permissions on ALL tables and sequences
grant_lookup_table_permissions()
Grant table-level permissions for lookup tables
grant_plot_insert_permissions()
Setup permissions for users to insert plots
backup_database()
Backup PostgreSQL database with timestamp
restore_database()
Restore database from backup
list_backups()
List available database backups
cleanup_old_backups()
Delete old database backups
diagnose_plot_permissions()
Diagnose plot insertion permissions
diagnose_add_person_setup()
Diagnose add_person function and permissions
check_citations_migration()
Check citations migration status
check_created_by_migration()
Check created_by Migration Status
check_taxa_permissions()
Check taxa database permissions
check_hierarchy_consistency()
Check Hierarchy Consistency
check_table_idtax_staleness()
Check table_idtax Staleness
get_table_idtax_metadata()
Get table_idtax Metadata
print_user_access_summary()
Print user access summary
setup_add_person_function()
Grant permissions for adding people to table_colnam
migrate_add_citations_table()
Migration: Add table_citations and id_citation FK to taxa_traits_measures
migrate_add_created_by()
Migration: Add created_by Column for Row-Level Security
migrate_table_idtax_to_materialized_view()
Migrate table_idtax to Materialized View
migration_add_audit_columns()
Add Audit Columns to data_link_specimens
migration_add_id_parent_column()
Add id_parent Column to table_taxa
migration_add_linktype_column()
Add id_linktype Column to data_link_specimens
migration_create_hierarchy_entries()
Create Missing Hierarchy Entries
migration_create_linktypelist()
Create linktypelist Lookup Table
migration_link_hierarchy()
Populate id_parent for Existing Entries
migration_link_infraspecific()
Link Infraspecific Taxa to Species (Step 5 only)
rollback_table_idtax_migration()
Rollback table_idtax Migration
run_hierarchy_migration()
Run Full Hierarchy Migration
run_specimen_links_migration()
Run Full Specimen Links Migration
test_table_idtax_migration()
Test table_idtax Materialized View Setup
verify_hierarchy_integrity()
Verify Hierarchy Integrity
verify_specimen_links_migration()
Verify Specimen Links Migration