Error in `tibble(Type = "A.", `S/N` = 1)`: could not find function "tibble"

test_that("export_results writes output files", {
# Create a temp prefix so we do not clutter the folder
export_results(df2, list, "Jan-25", prefix = prefix)
expect_true(file.exists(paste0(prefix, "Jan2025_Raw - Type A to D.csv")))
expect_true(file.exists(paste0(prefix, "Jan2025_Raw - Type A to D - For Chun Wei.csv")))
expect_true(file.exists(paste0(prefix, "Jan2025_Raw - Non-type A to D.csv")))

"Jan2025_Raw - Type A to D - For Chun Wei.csv"

Error in `write_csv(tibble(`Patient Class` = c("OP", "IPD", "SDA"), Subtype = c("(Re) Started Drug for Untreated Indication - Indication", "Dose or Frequency increased - Efficacy", "Stopped Drug because of duplicate therapy - Safety"), Response = c("Accepted", "Rejected", NA)), tmp)`: could not find function "write_csv"

test_that("load_and_clean removes SDA/IPD and adds columns", {
`Patient Class` = c("OP", "IPD", "SDA"),
"(Re) Started Drug for Untreated Indication - Indication",
"Dose or Frequency increased - Efficacy",
"Stopped Drug because of duplicate therapy - Safety"
Response = c("Accepted", "Rejected", NA)
# SDA and IPD should be removed → only 1 row left
expect_true("Process Related Causes" %in% names(out))

"load_and_clean removes SDA/IPD and adds columns"
"(Re) Started Drug for Untreated Indication - Indication"
"Dose or Frequency increased - Efficacy"

load_and_clean removes SDA/IPD and adds columns

Error in `tibble(Type = c("A.", "B.", "C.", "D.", "E.", "F.", NA), `S/N` = 1:7)`: could not find function "tibble"

test_that("split_for_AI splits A–D correctly", {
# Index into list with $ or [[]] to check A-D should be in Type A-D dataframe
# Index into list with $ or [[]] to check E, F and NA go to non-AD dataframe
# De-identification should replace Patient and MRN with S/N