R/errors_inputs.R

# The LAGO error codes of the input checks in R/validate_inputs.R. Several of
# them name a general kind of problem, such as "not_numeric" or
# "length_mismatch", so that other areas can reuse them for the same kind.
.lago_errors_inputs <- data.frame(
  code = c(
    "data_null",
    "data_not_data_frame",
    "data_empty",
    "not_one_string",
    "not_one_number",
    "not_true_false",
    "not_numeric",
    "not_character_vector",
    "not_a_list",
    "unsupported_option",
    "length_mismatch",
    "names_mismatch",
    "value_not_finite",
    "value_out_of_range",
    "value_outside_bounds",
    "column_not_found",
    "column_all_missing",
    "column_not_numeric",
    "column_infinite",
    "column_single_value",
    "column_name_invalid",
    "column_name_clash",
    "column_multiple_roles",
    "column_listed_twice",
    "duplicate_data_columns",
    "no_complete_rows",
    "outcome_out_of_range",
    "center_level_continuous",
    "center_level_outcome_name",
    "center_sample_size_invalid",
    "family_outcome_mismatch",
    "center_effects_with_characteristics",
    "center_effects_needed",
    "center_not_found",
    "weights_sum_not_one",
    "interaction_terms_missing",
    "interaction_terms_off",
    "main_components_missing",
    "interaction_in_main_components",
    "interaction_parts_not_main",
    "interaction_column_mismatch",
    "bounds_negative",
    "unit_cost_doses_invalid",
    "costs_missing",
    "goals_missing",
    "power_goal_needs_binary",
    "power_goal_with_minimize",
    "group_values_invalid",
    "group_arm_empty",
    "next_stage_missing",
    "too_few_clusters"
  ),
  description = c(
    "The data argument is NULL.",
    "The data argument is not a data frame.",
    "The data frame has no rows or no columns.",
    "An argument that takes one character string is not a string, is NA, or has another length.",
    "An argument that takes one number is not one finite number.",
    "An argument that takes TRUE or FALSE has another value.",
    "An argument that takes numbers is not numeric.",
    "An argument that takes column names is not a character vector.",
    "An argument that takes a list is not a list.",
    "An argument is not one of the values the package supports.",
    "An argument does not have the length it needs, such as one value per component.",
    "The names of a vector are not the names it is matched by, each once.",
    "An argument holds NA, NaN, Inf or -Inf where a finite number is needed.",
    "A number is outside the range the argument allows.",
    "A value lies outside the lower and upper bounds of its intervention component.",
    "A column the inputs name is not in the data.",
    "A column the model needs has no observed values.",
    "A column the model reads as numbers is not numeric.",
    "A column holds Inf or -Inf on rows the outcome model uses.",
    "A text, factor or logical column has only one value on the rows the model uses.",
    "A column name cannot be used in the model formula.",
    "A column name clashes with a column the confidence set adds.",
    "A column is given more than one role in the outcome model.",
    "A list of columns names the same column more than once.",
    "The data has more than one column with a name the model uses.",
    "No row has every model variable and its weight observed.",
    "The outcome has values outside the range its type or family allows.",
    "Center level data is given for a continuous outcome.",
    "Center level data is given with an outcome other than the proportion column.",
    "The center_sample_size column is missing, negative or not finite where it is needed.",
    "The glm family does not suit the outcome type.",
    "Both fixed center effects and center characteristics are asked for.",
    "Center weights are given while center effects are turned off.",
    "The center named for the optimization is not a center in the data.",
    "The center weights do not sum to 1.",
    "Interaction terms are asked for, but intervention_components has none.",
    "intervention_components has interaction terms, but interaction terms are turned off.",
    "Interaction terms are asked for without main_components.",
    "main_components holds an interaction term.",
    "A part of an interaction term is not in main_components.",
    "An interaction column does not hold the product of its components.",
    "A lower bound of an intervention component is negative.",
    "unit_cost_doses is not one finite dose for each unit cost.",
    "Neither unit_costs nor cost_list_of_vectors is given.",
    "Neither outcome_goal nor power_goal is given.",
    "A power goal is given for an outcome that is not binary.",
    "A power goal is given with the intention to minimize the outcome.",
    "The group column has values other than treatment and control.",
    "An arm of the group column has no rows with an observed outcome.",
    "A power goal is given without the size of the next stage.",
    "An arm has fewer than two clusters, so the icc design effect cannot be computed."
  ),
  stringsAsFactors = FALSE
)

Try the LAGOtrials package in your browser

Any scripts or data that you put into this service are public.

LAGOtrials documentation built on Dec. 4, 2026, 5:10 p.m.