You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO: update new fxns to work with a specified 'dir' instead of default 'getwd()'?
5
+
# TODO: update key quantities functions to work with a specified 'dir' instead of default 'getwd()'?
6
+
# TODO: update key quantities functions for plots that need to extract values from KQs csv to calculate their own, dependent KQs (none present in current plotting functions)
6
7
7
8
#' Substitute key quantities' values into template
Copy file name to clipboardExpand all lines: vignettes/how-caps-alttext-are-made.Rmd
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,12 +44,16 @@ After the final plot has been created within the function, key quantities are ca
44
44
45
45
**NOTE**: While we extract key quantities as accurately as we can, we cannot guarantee that each quantity will be calculated perfectly. Input data varies widely. It’s always your responsibility to check the accuracy of your figures' alt text.
46
46
47
+
**NOTE**: The key quantities are exported to a file saved to your working directory ("key_quantities.csv") via `export_kqs()`.
48
+
47
49
Next, the function `insert_kqs()` imports an empty or partially-filled template with captions and alternative text ("captions_alt_text_template.csv" or "captions_alt_text.csv", respectively), depending on if the user has already created a "captions_alt_text.csv" file in their working directory. The .csv file is imported as a dataframe.
48
50
49
51
The key quantities are substituted into the dataframe's appropriate placeholders. For example, "The y axis shows biomass in B.units, which spans from **B.min** to B.max." will changed to "The y axis shows biomass in B.units, which spans from **100** to B.max."
50
52
51
53
Finally, the function exports the updated dataframe as a new .csv, or overwrites the old version, to "captions_alt_text.csv".
52
54
55
+
**NOTE**: If you export a plot with the same filename (e.g., you exported a biomass plot, then decided to slightly change it and reexport), you will be prompted in the console to decide if you want to overwrite your original plot. You will NOT be prompted to decide if you want to overwrite your original plot's caption and alternative text with an updated version from your new plot, which may have different key quantities. To get updated key quantities, you must 1) revert the plot's caption and alternative text in "captions_alt_text.csv" to contain the placeholders present in the "captions_alt_text_template.csv" OR 2) edit those entries manually.
56
+
53
57
## Connecting the tables & figures with the captions & alternative text
54
58
55
59
The function `create_rda()` creates an R data ("rda") file containing a package with 1) the figure or table, 2) caption, 3) alternative text (if a figure) OR a LaTeX version of a table (if a table). To make this package of files, the following steps occur:
0 commit comments