Skip to content

Update custom figures/tables vignette#443

Open
sbreitbart-NOAA wants to merge 13 commits intodevfrom
custom-figs-vign
Open

Update custom figures/tables vignette#443
sbreitbart-NOAA wants to merge 13 commits intodevfrom
custom-figs-vign

Conversation

@sbreitbart-NOAA
Copy link
Copy Markdown
Collaborator

What is the feature?

  • Update custom figures/tables vignette

Does the PR impact any other area of the project, maybe another repo?

  • No

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Checklist

  • PR base branch is accurate
  • Is the code concise?
  • Comments are clear and useful.
  • Can you remove or combine any arguments?
  • Do argument contain defaults (if appliable)?
  • Code is documented and example provided (Roxygen).
  • Did you make a test (testthat)?
  • Was this tested under multiple scenarios?
  • Did you run devtools::check()?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
33.8% 1:0.2 24s

Reported by octocov


#### Tables

Follow the instructions in the appropriate section below based on your table classification: reg_reg, reg_long, wide_reg, wide_long, ewide_reg, or ewide_long.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be useful to list these instead and have them linked to each of their respective sections below


*Landscape orientation, split by column across multiple pages.*

Because extra-wide tables are split by column, you must have already run `export_split_tbls()` to create the `_split.rda` file. Load that split file to access the list of tables:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export_split_tbls() on their custom table? If so, would be good to explain that step here


#### Figures

The workflow for figures is very similar to the workflow for regular tables.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add at the end of this sentence something like "a set-up chunk followed by an executable chunk". I think it would be helpful to reiterate this and make it as clear as possible since this is not always intuituve.

``` markdown
![Your caption here](your_image.png){width=___in #fig-your_image_label_name}
```
> **NOTE**: Remember that alternative text placed in this markdown format will not be put into your final report file; it must be in the captions_alt_text.csv file. However, *you must put the caption here*.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to double check this, but I don't think this is necessarily true. I think there is a way this will work

> **NOTE**: It can be a headache to specify the correct image path. We recommend placing your files in either of these places:

1. Your report folder (path = the image name, like *image.png*)
2. A folder within your report folder (path = the relative filepath, like *images/image.png* if there's an images folder within report)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a third example that the NE just taught me which is relative to the folder "../../my_image.png" for example

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and maybe a folder structure diagram similar to the example below


``` markdown
# Example 1
![Here is my caption to my example figure.](my_custom_figure.png){width=3in #fig-custom_figure1}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the name of this example of the other like my_custom_figure.png to differentiate these so they understand that this is coming from a different directory than the next path. I think its clear to me but just to be safe

@@ -0,0 +1,248 @@
### Add custom tables and figures {#sec-add-plots_rda}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear that this process is for an rda. How would a user get to having an rda? Why would they do this over running create_figures_doc? I realized this was for rda through the section label which isn't rendered and then in the chunk for tables.


##### Long table (`reg_long` or `wide_long`)

Import your rda using the "Regular table" setup chunk. Long tables are split by row using `gt_split()`. You will need one chunk per page (e.g., if you have 2 pages, repeat the display chunk twice).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would cause additional work, but might be worth to mention that there's a bug in gt_split right now so they could use the asar export for now instead?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would also explain the line below in the example chunk

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reference this vignette in the add-plots-rda vignette

Copy link
Copy Markdown
Collaborator

@Schiano-NOAA Schiano-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! What an awesome resource for out users. I left a few comments to help with clarity and also questions. Could you figure out how to add a navigational side bar for the vignette now? It is pretty long and dense so I could see it being a bit complex to navigate especially when they already read through it and just want to find a specific part.

Once those changes are made, then good to merge :)

sbreitbart-NOAA and others added 5 commits April 10, 2026 15:53
Co-authored-by: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com>
Co-authored-by: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com>
Co-authored-by: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants