data-raw/DATASET.R

## code to prepare a `notification_db_dataset_sample`. This dataset is not real
## but it can be used for test purposes and to include in the documentation
## (e.g., vignettes).

library(generator)

set.seed(20210727)

size <- 55

state_epis <- data.frame(
  state = sample(state.abb, size = size, replace = TRUE),
  name = r_full_names(size),
  title = sample(
    c("State Epidemiologist", "Acting State Epidemiologist", "Epidemiologist"),
    size = size,
    replace = TRUE
  ),
  email = r_email_addresses(size),
  phone = r_phone_numbers(size, use_parentheses = T, use_hyphens = T),
  date_updated = Sys.Date()
)

pcc_contact <- data.frame(
  id = 1:size,
  name = r_full_names(size),
  email = r_email_addresses(size),
  phone = r_phone_numbers(size, use_parentheses = T, use_hyphens = T),
  alternate_phone = "",
  after_hour__phone = "",
  title = sample(
    c("PharmD", "DABAT", "FAACT"),
    size = size,
    replace = TRUE
  ),
  date_updated = Sys.Date()
)

# Make some work phone numbers blank to simulate original dataset
pcc_contact$phone[sample(1:size, size = 5)] <- NA

notification_db_dataset_sample <- list(
  state_epis = state_epis,
  pcc_contact = pcc_contact
)

usethis::use_data(notification_db_dataset_sample, overwrite = TRUE)


a <- create_label(notification_db_dataset_sample$pcc_contact[8:9,])
a <- shiny::HTML(a)

tmp <- tempfile(fileext = ".html")
writeLines(a, tmp)
browseURL(tmp)
renejuan/DERTtools documentation built on March 19, 2022, 7:20 a.m.