diff --git a/R/abundance_ratios.R b/R/abundance_ratios.R index 2ac7950..5b64a19 100644 --- a/R/abundance_ratios.R +++ b/R/abundance_ratios.R @@ -15,7 +15,7 @@ #' @param R47 Desired new name of the calculated ratio for mass 47. #' @param R48 Desired new name of the calculated ratio for mass 48. #' @param R49 Desired new name of the calculated ratio for mass 49. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export abundance_ratios <- function(.data, @@ -26,6 +26,7 @@ abundance_ratios <- function(.data, R45 = R45, R46 = R46, R47 = R47, R48 = R48, R49 = R49, quiet = NULL) { + rlang::check_dots_empty0(...) # global variables and defaults s44 <- s45 <- s46 <- s47 <- s48 <- s49 <- NULL diff --git a/R/acid_fractionation.R b/R/acid_fractionation.R index 6866831..fd33daa 100644 --- a/R/acid_fractionation.R +++ b/R/acid_fractionation.R @@ -10,7 +10,7 @@ #' @param D47 The column name of the \eqn{\Delta_47} values to use for the acid #' fractionation calculation. #' @param D47_out The desired new column name. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' #' @references @@ -34,6 +34,7 @@ acid_fractionation <- function(.data, aff = 0.062, ..., D47 = D47_etf, D47_out = D47_final, quiet = default(quiet)) { + rlang::check_dots_empty0(...) # global variables and defaults D47_etf <- D47_final <- NULL diff --git a/R/add_info.R b/R/add_info.R index 65d70c1..a5a0895 100644 --- a/R/add_info.R +++ b/R/add_info.R @@ -7,12 +7,13 @@ #' @param .info A [tibble][tibble::tibble-package], resulting from #' [clean_did_info()]. #' @param cols A character vector with column names in info to add to the data. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export #' @family metadata cleaning functions add_info <- function(.data, .info, ..., cols = NULL, quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0) { return(tibble(file_id = character())) } diff --git a/R/append_expected_values.R b/R/append_expected_values.R index c681bd5..65cd6ec 100644 --- a/R/append_expected_values.R +++ b/R/append_expected_values.R @@ -28,7 +28,7 @@ #' #' @export #' @family empirical transfer functions -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet append_expected_values <- function(.data, ..., @@ -39,6 +39,7 @@ append_expected_values <- function(.data, quiet = NULL) { # global variables and defaults `Identifier 1` <- expected_D47 <- NULL + rlang::check_dots_empty0(...) if (length(std_names) != length(std_values)) stop("std_names should be of equal length to std_values.") diff --git a/R/apply_etf.R b/R/apply_etf.R index 4a24637..be67916 100644 --- a/R/apply_etf.R +++ b/R/apply_etf.R @@ -14,12 +14,13 @@ #' @param raw The column with raw values to apply the ETF to. #' @param out The new column name. #' @family empirical transfer functions -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export apply_etf <- function(.data, ..., intercept = intercept, slope = slope, raw = D47_raw, out = D47_etf, quiet = NULL) { # defaults D47_raw <- D47_etf <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } diff --git a/R/bulk_and_clumping_deltas.R b/R/bulk_and_clumping_deltas.R index 39a44ba..650ed2c 100644 --- a/R/bulk_and_clumping_deltas.R +++ b/R/bulk_and_clumping_deltas.R @@ -16,7 +16,7 @@ #' @param d49 Column name of d49. #' @inheritParams isobar_ratios #' @inheritParams default.params -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @references Daeron, M., Blamart, D., Peral, M., & Affek, H. P., Absolute #' isotopic abundance ratios and the accuracy of \eqn{\Delta_{47}} @@ -36,6 +36,7 @@ bulk_and_clumping_deltas <- function(.data, ..., R18_PDBCO2 = default(R18_PDBCO2), lambda = default(lambda), D17O = default(D17O), quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } diff --git a/R/calculate_etf.R b/R/calculate_etf.R index 347d34b..5fdd245 100644 --- a/R/calculate_etf.R +++ b/R/calculate_etf.R @@ -11,7 +11,7 @@ #' @param intercept The column name of the new intercept. #' @param parallel Whether or not (default) to process this in parallel, using package `furrr`. #' @importFrom stats na.exclude -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @family empirical transfer functions #' @export @@ -20,6 +20,7 @@ calculate_etf <- function(.data, ..., session = Preparation, etf = etf, etf_coefs = etf_coefs, slope = slope, intercept = intercept, parallel = FALSE, quiet = NULL) { + rlang::check_dots_empty(...) # global variables and defaults if (parallel & !requireNamespace("furrr", quietly = TRUE)) { stop("Package \"furrr\" is needed for this function to work.\n Please install it or run this with `parallel = FALSE`", diff --git a/R/clean_did_info.R b/R/clean_did_info.R index d175baa..d3e94a9 100644 --- a/R/clean_did_info.R +++ b/R/clean_did_info.R @@ -8,12 +8,13 @@ #' @seealso [isoreader::iso_read_dual_inlet()] #' @seealso [isoreader::iso_get_file_info()] #' @family metadata cleaning functions -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet clean_did_info <- function(.did, masspec = NULL, ..., std_names = c(paste0("ETH-", 1:4), "IAEA-C2", "Merck"), oth_name = "other", quiet = NULL) { + rlang::check_dots_empty(...) if (is.null(quiet)) { quiet <- default(quiet) } diff --git a/R/collapse_cycles.R b/R/collapse_cycles.R index 7197077..2e46fce 100644 --- a/R/collapse_cycles.R +++ b/R/collapse_cycles.R @@ -11,7 +11,7 @@ #' @param alpha The confidence level for the summary functions. #' @param na.rm a logical value indicating wheter NA values should be stripped #' before the computation proceeds. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export collapse_cycles <- function(.data, @@ -24,6 +24,7 @@ collapse_cycles <- function(.data, na.rm = TRUE, quiet = NULL) { outlier_cycle <- d13C_PDB <- d18O_PDB <- D47_raw <- D47_final <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } @@ -65,6 +66,7 @@ collapse_cycles <- function(.data, #' columns that have cycle information based on previous computation steps. #' #' @param .data A [tibble][tibble::tibble-package] resulting from [bulk_and_clumping_deltas()]. +#' @param ... Additional chacter vectors to nest by. #' @param masses The masses that are present in the mass spectrometer. Defaults to 44:49 and 54. #' @param ratios Ratio columns, based on masses. #' @param outlier_cycles Columns with outlier_cycle information. @@ -80,7 +82,6 @@ collapse_cycles <- function(.data, #' @param flags Flag columns. #' @param Deltas Big delta values. #' @param p49 Param 49. -#' @inheritParams dots #' @inheritParams quiet #' @export nest_cycle_data <- function(.data, diff --git a/R/correct_backgrounds.R b/R/correct_backgrounds.R index e9ba9dc..39f2a97 100644 --- a/R/correct_backgrounds.R +++ b/R/correct_backgrounds.R @@ -7,7 +7,7 @@ #' @param factor Factor by which to multiply the half-cup before subtraction. #' @param i47 Column with mass 47 intensities to correct. #' @param i54 Column with mass 47.5 intensities to use for correction. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export correct_backgrounds <- function(.data, factor, ..., @@ -15,6 +15,7 @@ correct_backgrounds <- function(.data, factor, ..., quiet = default(quiet)) { # global variables and defaults v47.mV <- v54.mV <- NULL + rlang::check_dots_empty0(...) if (!quiet) glue("Info: adding background based on half-mass with factor {factor}") %>% diff --git a/R/delta_values.R b/R/delta_values.R index c5bee33..8fc9dfa 100644 --- a/R/delta_values.R +++ b/R/delta_values.R @@ -4,11 +4,12 @@ #' [correct_backgrounds()]. #' @details This function is a wrapper for the [abundance_ratios()], #' [little_deltas()], and [bulk_and_clumping_deltas()] functions. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export delta_values <- function(.data, ..., quiet = NULL) { R45_wg <- R46_wg <- R47_wg <- R48_wg <- R49_wg <- NULL + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } diff --git a/R/empirical_transfer_function.R b/R/empirical_transfer_function.R index f3695d3..86244a4 100644 --- a/R/empirical_transfer_function.R +++ b/R/empirical_transfer_function.R @@ -10,7 +10,7 @@ #' @inheritParams append_expected_values #' @inheritParams calculate_etf #' @inheritParams apply_etf -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @details This function is a wrapper for [append_expected_values()], #' [calculate_etf()], and [apply_etf()]. @@ -41,6 +41,7 @@ empirical_transfer_function <- function(.data, parallel = FALSE) { # defaults from above D47_raw <- expected_D47 <- D47_etf <- `Identifier 1` <- Preparation <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } diff --git a/R/find_bad_cycles.R b/R/find_bad_cycles.R index d2b78eb..58b67d5 100644 --- a/R/find_bad_cycles.R +++ b/R/find_bad_cycles.R @@ -19,7 +19,7 @@ #' @param cycle Column name of the column with the measurement cycle number. #' @param relative_to cycle Drop detection occurs relative to either the first #' cycle ("init", default) or to the previous cycle ("prev"). -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export #' @family cycle functions @@ -28,6 +28,7 @@ find_bad_cycles <- function(.data, ..., v44 = "v44.mV", cycle = "cycle", relative_to = "init", quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } diff --git a/R/find_outliers.R b/R/find_outliers.R index 5bdae77..7797671 100644 --- a/R/find_outliers.R +++ b/R/find_outliers.R @@ -19,7 +19,7 @@ #' @param D47 The column with \eqn{\Delta_{47}} values. #' @param session Column name that defines correction session. #' @param id1 Column name of the sample/standard identifier. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export find_outliers <- function(.data, @@ -36,6 +36,7 @@ find_outliers <- function(.data, quiet = NULL) { # default quoted arguments are bad, hmkay D47_raw <- Preparation <- `Identifier 1` <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) @@ -72,13 +73,14 @@ find_outliers <- function(.data, ##' @param init_low Column in .data with minimum initial intensity threshold for mass 44. ##' @param init_high Column in .data with maximum initial intensity threshold for mass 44. ##' @param init_diff Column in .data with maximum initial difference in mass 44 threshold between standard and sample gas. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet ##' @export find_init_outliers <- function(.data, init_low, init_high, init_diff, ..., quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } @@ -107,9 +109,10 @@ find_init_outliers <- function(.data, ##' Find measurements with a param49 value that is greater than \code{param49_off}. ##' @param .data A [tibble][tibble::tibble-package] with raw Delta values and file information. ##' @param param49_off The absolute cutoff value for the parameter 49 value. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet find_param49_outliers <- function(.data, param49_off, ..., quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } @@ -134,12 +137,13 @@ find_param49_outliers <- function(.data, param49_off, ..., quiet = NULL) { ##' @param .data A [tibble][tibble::tibble-package] with raw Delta values and file information. ##' @param internal_sd The internal standard deviation cutoff value. ##' @param D47 The column to calculate the internal sd value for. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet ##' @export find_internal_sd_outlier <- function(.data, internal_sd = .15, ..., D47 = D47_raw, quiet = NULL) { + rlang::check_dots_empty0(...) `Identifier 1` <- D47_raw <- NULL if (is.null(quiet)) { quiet <- default(quiet) @@ -166,12 +170,13 @@ find_internal_sd_outlier <- function(.data, internal_sd = .15, ..., #' @param session The session for which to calculate the standard deviation and median values. #' @param outlier_session Column name of new output column. #' @export -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet find_session_outlier <- function(.data, ..., n = 5, nsd_off = 4, D47 = D47_raw, outlier_session = outlier_session_D47, session = Preparation, quiet = NULL) { D47_raw <- Preparation <- outlier_session_D47 <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } @@ -200,13 +205,14 @@ find_session_outlier <- function(.data, ..., #' @param D47 The column to calculate the internal sd value for. #' @param session The session for which to calculate the standard deviation and median values. #' @param id1 The column that defines the sample/standard name. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet ##' @export find_session_id1_outlier <- function(.data, ..., n_id1 = 5, nsd_off = 4, D47 = D47_raw, session = Preparation, id1 = `Identifier 1`, quiet = NULL) { D47_raw <- Preparation <- `Identifier 1` <- outlier <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) @@ -235,10 +241,11 @@ find_session_id1_outlier <- function(.data, ..., #' #' @param .data A [tibble][tibble::tibble-package] with raw Delta values and file information. #' @param out_column The name of the outlier column. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export summarise_outlier <- function(.data, out_column = outlier, ..., quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } diff --git a/R/isobar_ratios.R b/R/isobar_ratios.R index 948b5a7..cae9088 100644 --- a/R/isobar_ratios.R +++ b/R/isobar_ratios.R @@ -15,7 +15,7 @@ #' @param R48 The output column name for R48. #' @param R49 The output column name for R49. #' @inheritParams default.params -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' #' @references Daeron, M., Blamart, D., Peral, M., & Affek, H. P., Absolute @@ -38,6 +38,7 @@ isobar_ratios <- function(.data, D47 = default(D47), D48 = default(D48), D49 = default(D49)) { + rlang::check_dots_empty0(...) .data %>% mutate( # Compute R17 diff --git a/R/little_deltas.R b/R/little_deltas.R index c06a317..552e602 100644 --- a/R/little_deltas.R +++ b/R/little_deltas.R @@ -4,10 +4,11 @@ #' \deqn{\delta_i = (R_i / R_iwg - 1) \times 1000} #' #' @param .data A [tibble][tibble::tibble-package] with abundance ratios. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export little_deltas <- function(.data, ..., quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } diff --git a/R/reference_gas_delta.R b/R/reference_gas_delta.R index 7e98134..84178bd 100644 --- a/R/reference_gas_delta.R +++ b/R/reference_gas_delta.R @@ -4,7 +4,7 @@ #' @param .did An iso file, resulting from [isoreader::iso_read_dual_inlet()]. #' @param d13C_PDB_wg \eqn{\delta^{13}C} reference gas value to overwrite. #' @param d18O_PDBCO2_wg \eqn{\delta^{18}O} reference gas value to overwrite. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export append_ref_deltas <- function(.data, .did = NULL, @@ -12,6 +12,7 @@ append_ref_deltas <- function(.data, .did = NULL, d13C_PDB_wg = NULL, d18O_PDBCO2_wg = NULL, quiet = NULL) { + rlang::check_dots_empty0(...) if (!any(class(.data) %in% c("data.frame", "tbl_df", "tbl"))) { stop("`.data` must be a data.frame or tibble", call. = FALSE) } diff --git a/R/remove_outliers.R b/R/remove_outliers.R index 554d92f..031a061 100644 --- a/R/remove_outliers.R +++ b/R/remove_outliers.R @@ -12,7 +12,7 @@ #' Preparation of the standards. #' @param D47 The column with \eqn{\Delta_47} values. Defaults to `D47_raw_mean`. #' @inheritParams find_outliers -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @export remove_outliers <- function(.data, @@ -30,6 +30,7 @@ remove_outliers <- function(.data, quiet = NULL) { # global variables and defaults D47_raw <- file_datetime <- Preparation <- `Identifier 1` <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } diff --git a/R/spread_match.R b/R/spread_match.R index 22640cb..2cedef6 100644 --- a/R/spread_match.R +++ b/R/spread_match.R @@ -6,6 +6,7 @@ spread_match <- function(.data, ..., method = "normal", masses = c(44:49, 54), quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } @@ -37,12 +38,13 @@ spread_match <- function(.data, ..., #' @param names_pattern Regular expression passed to [[tidyr::pivot_longer]]. #' @return A [tibble][tibble::tibble-package] with the sample and reference #' gasses side-by-side. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet spread_intensities <- function(.data, ..., ids = NULL, our_cols = NULL, names_pattern = "v([4-9]{2}).(mV)", quiet = NULL) { + rlang::check_dots_empty0(...) if (nrow(.data) == 0L) { return(tibble(file_id = character())) } @@ -114,10 +116,11 @@ spread_intensities <- function(.data, ..., #' @param method "linterp" for linear interpolation, or "normal" for #' conventional bracketing of sample gas. #' @param masses The masses to generate r and s columns from. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet match_intensities <- function(.data, ..., method = "normal", masses = c(44:49, 54), quiet = NULL) { + rlang::check_dots_empty0(...) our_cols <- c(paste0("s", masses), paste0("r", masses)) if (nrow(.data) == 0L) { diff --git a/R/temperature_calculation.R b/R/temperature_calculation.R index 8d8475f..a97830c 100644 --- a/R/temperature_calculation.R +++ b/R/temperature_calculation.R @@ -9,7 +9,7 @@ #' @param temp The column name of the output temperature. #' @param slope Character(1) column name with the slope. #' @param intercept Character(1) column name with the intercept. -#' @inheritParams dots +#' @inheritParams rlang::args_dots_empty #' @inheritParams quiet #' @seealso revcal tempcal #' @export @@ -19,6 +19,7 @@ temperature_calculation <- function(.data, ..., quiet = NULL) { # global variables and defaults D47_final <- temperature <- NULL + rlang::check_dots_empty0(...) if (is.null(quiet)) { quiet <- default(quiet) } diff --git a/R/utils.R b/R/utils.R index 8cbecd0..a03d0f1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -25,10 +25,6 @@ temperature_axis <- function(slope = 0.0449, intercept = 0.167) { ~ sqrt((slope * 1e6) / (. - intercept)) - 273.15 } -#' @name dots -#' @param ... These dots are for future extensions and must be empty. -NULL - #' @name quiet #' @param quiet If `TRUE`, print info messages. If `NULL` (default) listens to `options(clumpedr.quiet)` NULL diff --git a/man/nest_cycle_data.Rd b/man/nest_cycle_data.Rd index 945fe8b..ceb9cd5 100644 --- a/man/nest_cycle_data.Rd +++ b/man/nest_cycle_data.Rd @@ -33,7 +33,7 @@ nest_cycle_data( \arguments{ \item{.data}{A \link[tibble:tibble-package]{tibble} resulting from \code{\link[=bulk_and_clumping_deltas]{bulk_and_clumping_deltas()}}.} -\item{...}{These dots are for future extensions and must be empty.} +\item{...}{Additional chacter vectors to nest by.} \item{masses}{The masses that are present in the mass spectrometer. Defaults to 44:49 and 54.} diff --git a/tests/testthat/test-spread_match_intensities.R b/tests/testthat/test-spread_match_intensities.R index d8915c9..acffc35 100644 --- a/tests/testthat/test-spread_match_intensities.R +++ b/tests/testthat/test-spread_match_intensities.R @@ -32,7 +32,7 @@ test_that("spread_match wrapper works", { standards %>% isoreader::iso_get_raw_data(include_file_info = "Analysis") %>% mutate(dis_min = 500, dis_max = 50000, dis_fac = 3) |> - find_bad_cycles(min = "dis_min", max = "dis_max", fac = "dis_fac", relative_tove_to = "init") |> + find_bad_cycles(min = "dis_min", max = "dis_max", fac = "dis_fac", relative_to = "init") |> spread_match(), "tbl_df") })