data-raw/st_dtypes.R

# be sure to run this script whenever you update the data types
# so that the updated datatype object will be stored in /data/
# documentation for this is in /R/st_dtypes.R

st_dtypes <- list(
  logical =
    c("academic_primary_estimate",
      "dashboard_primary_estimate",
      "pop_adj",
      "superceded",
      "test_adj",
      "geo_exact_match",
      "include_in_srma"),
  double =
    c("case_count_0",
      "case_count_neg14",
      "case_count_neg9",
      "case_population",
      "death_count_plus11",
      "death_count_plus4",
      "deaths_population",
      "sensitivity",
      "specificity",
      "adj_sensitivity",
      "adj_specificity",
      "ind_se",
      "ind_sp",
      "pin_latitude",
      "pin_longitude",
      "seroprev_95_ci_lower",
      "seroprev_95_ci_upper",
      "serum_pos_prevalence",
      "adj_prev_ci_lower",
      "adj_prev_ci_upper",
      "adj_prevalence",
      "cases_per_hundred",
      "deaths_per_hundred",
      "full_vaccinations_per_hundred",
      "vaccinations_per_hundred",
      "tests_per_hundred"),
  integer =
    c("age_max",
      "age_min",
      "denominator_value",
      "ind_se_n",
      "ind_sp_n",
      "number_of_females",
      "number_of_males",
      "numerator_value",
      "se_n",
      "sp_n"),
  character =
    c("age_variation",
      "average_age",
      "country",
      "country_iso3",
      "estimate_name",
      "ind_eval_lab",
      "ind_eval_link",
      "population_group",
      "sample_frame_info",
      "source_id",
      "source_name",
      "study_name",
      "subgroup_var",
      "subgroup_cat",
      "test_linked_uid",
      "test_name",
      "url",
      "subgroup_specific_category",
      "first_author",
      "lead_organization",
      "source_publisher",
      "summary"),
  date =
    c("sampling_end_date",
      "sampling_start_date",
      "publication_date",
      "date_created",
      "last_modified_time"),
  factor =
    c("age",
      "age_variation_measure",
      "estimate_grade",
      "gbd_region",
      "gbd_subregion",
      "genpop",
      "isotype_comb",
      "jbi_1", "jbi_2", "jbi_3",
      "jbi_4", "jbi_5", "jbi_6",
      "jbi_7", "jbi_8", "jbi_9",
      "lmic_hic",
      "measure_of_age",
      "overall_risk_of_bias",
      "pin_region_type",
      "sampling_type",
      "sex",
      "source_type",
      "specimen_type",
      "test_not_linked_reason",
      "test_type",
      "test_validation",
      "study_type",
      "ind_eval_type"),
  list =
    c("antibody_target",
      "city",
      "isotypes_reported",
      "state",
      "test_manufacturer")
)

usethis::use_data(st_dtypes, overwrite = TRUE)
serotracker/serosurvr documentation built on July 1, 2022, 7:49 p.m.