Generates a time-series plot of XLM values for one or more ETFs, with
optional back-translation of the displayed ticker labels via the
fundsr.xetra_map option.
Arguments
- xlm_data
A data frame containing XLM observations, including columns
date,xlm,ticker, andname.- tickers
Character vector of tickers to plot, or a pattern if
rgx = TRUE.- rgx
Logical; if
TRUE,tickersis treated as a regular expression and matched against thenamecolumn; otherwise it is matched against thetickercolumn.- gg_params
Optional list of additional ggplot components (such as themes, scales, or labels) to be added to the base plot.
- back_trans
Logical; if
TRUE, replaces values in thetickercolumn after filtering using the inverse of the mapping stored in thefundsr.xetra_mapoption. This affects only what is displayed (legend labels and color grouping), not which rows are selected.
Details
If rgx = FALSE, the data are filtered by matching tickers against the
ticker column. If rgx = TRUE, tickers is treated as a regular
expression and matched against the name column.
When back_trans = TRUE, the function reads getOption("fundsr.xetra_map"),
expected to be a named character vector mapping internal identifiers to
Xetra tickers, for example:
c(fwra = "fwia", acwi = "lyy0").
The mapping is inverted and applied to the already-filtered data so that
occurrences of Xetra tickers in the plotted data are replaced by their
internal identifiers in the plot's legend and grouping.
Examples
if (FALSE) { # \dontrun{
options(fundsr.xetra_map = c(fwra = "fwia", acwi = "lyy0", iwda = "eunl", cw8 = "amew"))
# Filter by tickers as they appear in xlm_data$ticker, but display back-translated labels
plot_xlms(xlm_data, tickers = c("fwia", "eunl"), back_trans = TRUE)
# Regex match against the `name` column
# (back-translation, if enabled, still happens after filtering)
plot_xlms(xlm_data, tickers = "MSCI World", rgx = TRUE, back_trans = TRUE)
} # }