tests/testthat/_snaps/addins.md

string_create_aftable skeleton is okay

[1] "my_aftable <-\n  aftables::create_aftable(\n    tab_titles = c(\"Cover\", \"Contents\", \"Notes\", \"Table_1\", \"Table_2\"),\n    sheet_types = c(\"cover\", \"contents\", \"notes\", \"tables\", \"tables\"),\n    sheet_titles = c(\n      \"The 'aftables' Demo Workbook\",\n      \"Table of contents\",\n      \"Notes\",\n      \"Table 1: First Example Sheet\",\n      \"Table 2: Second Example Sheet\"\n    ),\n    blank_cells = c(\n      rep(NA_character_, 3),\n      \"Blank cells indicate that there's no note in that row.\",\n      NA_character_\n    ),\n    custom_rows = list(\n      NA_character_,\n      \"A custom row in the Contents sheet.\",\n      NA_character_,\n      c(\n        \"First custom row for Table 1.\",\n        \"A second custom row [with a hyperlink.](https://best-practice-and-impact.github.io/aftables/)\"\n      ),\n      \"A custom row for Table 2\"\n    ),\n    sources = c(\n      rep(NA_character_, 3),\n      \"[The Source Material, 2024](https://best-practice-and-impact.github.io/aftables/)\",\n      \"The Source Material, 2024\"\n    ),\n    tables = list(cover_list, contents_df, notes_df, table_1_df, table_2_df)\n  )"

string_tables_tibble skeleton is okay

[1] "cover_list <- list(\n  \"Section 1\" = c(\"First row of Section 1.\", \"Second row of Section 1.\"),\n  \"Section 2\" = \"The only row of Section 2.\",\n  \"Section 3\" = c(\n    \"[Website](https://best-practice-and-impact.github.io/aftables/)\",\n    \"[Email address](mailto:fake.address@aftables.com)\"\n  )\n)\n\ncontents_df <- data.frame(\n  \"Sheet name\" = c(\"Notes\", \"Table 1\", \"Table 2\"),\n  \"Sheet title\" = c(\n    \"Notes used in this workbook\",\n    \"First Example Sheet\",\n    \"Second Example Sheet\"\n  ),\n  check.names = FALSE\n)\n\nnotes_df <- data.frame(\n  \"Note number\" = paste(\"[note \", 1:2, \"]\"),\n  \"Note text\" = c(\"First note.\", \"Second note.\"),\n  check.names = FALSE\n)\n\ntable_1_df <- data.frame(\n  Category = LETTERS[1:10],\n  Numeric = 1:10,\n  \"Numeric suppressed\" = c(1:4, \"[c]\", 6:9, \"[x]\"),\n  \"Numeric thousands\" = abs(round(rnorm(10), 4) * 1e5),\n  \"Numeric decimal\" = abs(round(rnorm(10), 5)),\n  \"Long name that means that the column width needs to be widened\" = 1:10,\n  Notes = c(\"[note 1]\", rep(NA_character_, 4), \"[note 2]\", rep(NA_character_, 4)),\n  check.names = FALSE\n)\n\ntable_2_df <- data.frame(Category = LETTERS[1:10], Numeric = 1:10)"


Try the aftables package in your browser

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

aftables documentation built on April 12, 2025, 9:16 a.m.