diff --git a/NAMESPACE b/NAMESPACE index 24b2e431..32130b93 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,7 +4,6 @@ export("%>%") export(build_add_version) export(build_combine) export(build_setup_pipeline) -export(build_update_taxonomy) export(check_duplicates) export(dataset_build) export(dataset_configure) @@ -12,6 +11,7 @@ export(dataset_find_taxon) export(dataset_process) export(dataset_report) export(dataset_test) +export(dataset_update_taxonomy) export(get_schema) export(get_unit_conversions) export(metadata_add_contexts) diff --git a/R/process.R b/R/process.R index e7995e0d..d3a00900 100644 --- a/R/process.R +++ b/R/process.R @@ -279,7 +279,7 @@ dataset_process <- function(filename_data_raw, #' Build dataset #' #' Build specified dataset. This function completes three steps, which can be executed separately if desired: -#' `dataset_configure`, `dataset_process`, `build_update_taxonomy` +#' `dataset_configure`, `dataset_process`, `dataset_update_taxonomy` #' #' @param filename_metadata Metadata yaml file for a given study #' @param filename_data_raw Raw `data.csv` file for any given study @@ -319,7 +319,7 @@ dataset_build <- function( dataset_raw <- dataset_process( filename_data_raw, dataset_config, schema, resource_metadata, unit_conversion_functions, filter_missing_values = filter_missing_values) - dataset <- build_update_taxonomy(dataset_raw, taxon_list) + dataset <- dataset_update_taxonomy(dataset_raw, taxon_list) dataset } @@ -1860,7 +1860,7 @@ build_combine <- function(..., d = list(...)) { #' @importFrom rlang .data #' #' @export -build_update_taxonomy <- function(austraits_raw, taxa) { +dataset_update_taxonomy <- function(austraits_raw, taxa) { columns_in_taxon_list <- names(taxa) diff --git a/R/testdata.R b/R/testdata.R index 4a5863da..146f56b5 100644 --- a/R/testdata.R +++ b/R/testdata.R @@ -327,8 +327,8 @@ dataset_test_worker <- }, info = "`dataset_process`") expect_no_error({ - build_dataset <- build_update_taxonomy(build_dataset_raw, taxon_list) - }, info = "`build_update_taxonomy`") + build_dataset <- dataset_update_taxonomy(build_dataset_raw, taxon_list) + }, info = "`dataset_update_taxonomy`") build_dataset } diff --git a/_pkgdown.yml b/_pkgdown.yml index 086c68e3..d1c1f42b 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -34,7 +34,7 @@ reference: - '`build_setup_pipeline`' - '`build_combine`' - '`build_add_version`' - - '`build_update_taxonomy`' + - '`dataset_update_taxonomy`' - '`dataset_build`' - '`dataset_configure`' - '`dataset_process`' diff --git a/inst/support/build_base.whisker b/inst/support/build_base.whisker index a3b882a4..c3820d5e 100644 --- a/inst/support/build_base.whisker +++ b/inst/support/build_base.whisker @@ -16,7 +16,7 @@ taxon_list <- read_csv_char("config/taxon_list.csv") {{#dataset_ids}} {{dataset_id}}_config <- dataset_configure("{{path}}/{{dataset_id}}/metadata.yml", definitions) {{dataset_id}}_raw <- dataset_process("{{path}}/{{dataset_id}}/data.csv", {{dataset_id}}_config, schema, resource_metadata, unit_conversions) -{{dataset_id}} <- build_update_taxonomy({{dataset_id}}_raw, taxon_list) +{{dataset_id}} <- dataset_update_taxonomy({{dataset_id}}_raw, taxon_list) {{/dataset_ids}} diff --git a/inst/support/build_remake.whisker b/inst/support/build_remake.whisker index 9229023b..a9f51ad1 100644 --- a/inst/support/build_remake.whisker +++ b/inst/support/build_remake.whisker @@ -46,7 +46,7 @@ targets: ) {{dataset_id}}: command: > - build_update_taxonomy({{dataset_id}}_raw, + dataset_update_taxonomy({{dataset_id}}_raw, taxon_list ) diff --git a/man/dataset_build.Rd b/man/dataset_build.Rd index 57981f2c..bd169099 100644 --- a/man/dataset_build.Rd +++ b/man/dataset_build.Rd @@ -38,7 +38,7 @@ List, AusTraits database object } \description{ Build specified dataset. This function completes three steps, which can be executed separately if desired: -`dataset_configure`, `dataset_process`, `build_update_taxonomy` +`dataset_configure`, `dataset_process`, `dataset_update_taxonomy` } \examples{ \dontrun{ diff --git a/man/build_update_taxonomy.Rd b/man/dataset_update_taxonomy.Rd similarity index 79% rename from man/build_update_taxonomy.Rd rename to man/dataset_update_taxonomy.Rd index 1ee59197..34e6ce89 100644 --- a/man/build_update_taxonomy.Rd +++ b/man/dataset_update_taxonomy.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/process.R -\name{build_update_taxonomy} -\alias{build_update_taxonomy} +\name{dataset_update_taxonomy} +\alias{dataset_update_taxonomy} \title{Apply taxonomic updates to austraits_raw} \usage{ -build_update_taxonomy(austraits_raw, taxa) +dataset_update_taxonomy(austraits_raw, taxa) } \arguments{ \item{austraits_raw}{AusTraits compiled data as a large list without taxonomic updates applied} diff --git a/tests/testthat/functions.R b/tests/testthat/functions.R index c4ae1d6b..53dd8428 100644 --- a/tests/testthat/functions.R +++ b/tests/testthat/functions.R @@ -107,8 +107,8 @@ test_build_dataset <- function( }, info = paste(info, "`dataset_process`")) expect_no_error({ - build_dataset <- build_update_taxonomy(build_dataset_raw, taxon_list) - }, info = paste(info, "`build_update_taxonomy`")) + build_dataset <- dataset_update_taxonomy(build_dataset_raw, taxon_list) + }, info = paste(info, "`dataset_update_taxonomy`")) test_structure(build_dataset, info, schema, definitions, single_dataset = TRUE) diff --git a/tests/testthat/test-setup.R b/tests/testthat/test-setup.R index aabd3d76..d5550862 100644 --- a/tests/testthat/test-setup.R +++ b/tests/testthat/test-setup.R @@ -666,8 +666,8 @@ test_that("`build_setup_pipeline` is working", { expect_equal(austraits$build_info$git_SHA, sha) expect_equal(austraits$build_info$git_SHA, "6c73238d8d048781d9a4f5239a03813be313f0dd") - #expect_length(austraits_raw$taxa, 14) #not valid test with new `build_update_taxonomy setup` - #expect_length(austraits$taxa, 14) #not valid test with new `build_update_taxonomy setup` + #expect_length(austraits_raw$taxa, 14) #not valid test with new `dataset_update_taxonomy setup` + #expect_length(austraits$taxa, 14) #not valid test with new `dataset_update_taxonomy setup` expect_equal(nrow(austraits$taxa), nrow(austraits_raw$taxa)) # Compare products from three methods, except `build_info`