View source: R/plotstyle.add.R
plotstyle.add | R Documentation |
Adds plot styles locally as a per-session setting and returns a dataframe with all plot styles including the added data.
plotstyle.add(
entity,
legend,
color,
marker = NULL,
linestyle = NULL,
replace = FALSE,
write_file = FALSE
)
entity |
Vector of strings with names of entities (regions, variable names, etc.) |
legend |
Vector of strings with legend names of entities. |
color |
Vector of strings containing hexadecimal color codes. |
marker |
optional Vector of strings with marker codes. |
linestyle |
optional Vector of strings containing linestyle codes. |
replace |
Logical (default |
write_file |
If |
By default, plot styles of already existing entities will not be changed.
Only new entities will be added. Use the replace
switch to replace
existing styles. If you want to keep the legend text or the color of an
already existing entity and only replace one of the two values, use the
string "keep"
for the value you want to keep.
To change plot styles permanently, use the writefile
argument to write the
updated plot styles to a .csv
file, use it to update
./inst/extdata/plotstyle.csv
, and build a new package version.
David Klein, Jan Philipp Dietrich
plotstyle()
## Not run: plotstyle.add("AFR", "Africa", "#000000")
## Not run: plotstyle.add("AFR", "keep", "#FFFFFF")
## Not run: plotstyle.add("AFR", "keep", "keep", marker = 20, replace = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.