ref_range | R Documentation |
Often users will want to reference a range of figures that pertain to a particular data type. For example, you may want to reference the conditional age-at-length figures for a particular fleet. But what happens when the number of figures changes when you add or remove fleets or years included in the model? Worst case, you have to find everywhere in the markdown or LaTeX code that this figure type is referenced and change each line. Instead, you can use this function to find the references for you. All you need is to supply the a bit of the files that you are looking for and which fleet(s) is of interest to you.
ref_range(
figuredata,
grep,
column = "file",
fleets = get_fleet(col = "num"),
fleettype = "",
encapsulate = TRUE
)
figuredata |
A data frame of specifications for figures within your document. This data frame is most often automatically generated and specific to your model. |
grep |
A character string to search for in |
column |
The column name that you want to search for |
fleets |
Either numeric values or a valid character string that can be used to find the rows of the fleet table that are of interest. Depending on how you made your csv files via r4ss::SS_plot the references to fleets in the csv might be different. Select the appropriate column of get_fleet based on how you made the figures. |
fleettype |
A value to append to |
encapsulate |
A logical value specifying if you want the result to be encapsulated in round brackets. |
Try testing this function out before you include it in your .Rmd file.
All you will need is the file path to the csv that contains the information
in figuredata
and you can use utils::read.csv right in the call to this
function so you don't pollute your workspace. The result of this function
should look exactly like how you want it to appear in your document, except
the @ symbol will be double escaped instead of just single escaped.
Trust me, it will still work like this.
A character string formatted for markdown.
Kelli F. Johnson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.