geom_sii_riskoutline {ggsolvencyii} | R Documentation |
geom_sii_riskoutline
Description
returns a 'ggplot2' object, based on geom_path with the outlines concentric circle(part)s, defined by the values in a hierarchy of levels. This can be used instead of geom_sii_risksurface to plot the composition of the SCR. When optional aes(thetic) 'comparewithid' is passed to the geom_sii_riskoutline then the second SCR can be an overlay over another, for easy comparison.
Usage
geom_sii_riskoutline(data = NULL, mapping = NULL,
stat = "sii_riskoutline",
structure = ggsolvencyii::sii_structure_sf16_eng, squared = FALSE,
levelmax = 99, aggregatesuffix = "_other", plotdetails = NULL,
rotationdegrees = NULL, rotationdescription = NULL,
maxscrvalue = NULL, scalingx = 1, scalingy = 1,
position = "identity", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...)
Arguments
data |
the dataset in tidyverse format (column 'description' as a factor). see examples in |
mapping |
required aes(thetics) : 'x' (i.e. time, longitude, integer), 'y' (i.e SCR ratio, lattitude), 'id', 'description', 'value'. Optional aes is 'comparewithid' |
stat |
default stat is statsii_riskoutline, combinations with other stat's are not tested |
structure |
(dataframe: default =
. In the standard formula structure, SCR has level 1, with childlevel 2. This means it consists of all datalines with level == 2, ie. "BSCR", "operational" and "Adjustment-LACDT". lines in the dataset with a suffix "d" behind the levelnumber are diversification items. As of now these are not used in any calculation. the values in column "description" in the dataset need to match the description in this file. The package contains also a file |
squared |
(optional, boolean, default = FALSE) |
levelmax |
(integer or dataframe, default = 99) |
aggregatesuffix |
(string, default = "_other") |
plotdetails |
a table with columns 'levelordescription' and 'outline1' to 'outline4', indicating which outlines of which circle elements to plot. When no table is provided all segments are plotted. example 3 shows how to combine geom_sii_risksurface and geom_sii_riskoutline by using using table |
rotationdegrees |
(optional, integer, -360 to 360, default = NULL) |
rotationdescription |
(optional, string, default = NULL) |
maxscrvalue |
(optional, double, default = NULL) |
scalingx |
(optional, positive value ,default = 1) |
scalingy |
(optional, positive value ,default = 1) |
position |
standard ggplot function |
na.rm |
standard ggplot function |
show.legend |
standard ggplot function |
inherit.aes |
standard ggplot function |
... |
ellipsis, a standard R parameter |
Details
When describing an outline of a circle part 4 segments can be distinguised, radial line outwards, outer circle segment, radial line inwards, inner circle segment. Whether or not to plot these lines can be determined with an outline dataframe. by means of the column aes()value comparewithid in the data an overlay can be made to compare two SCR representations.
Value
a 'ggplot2' object geom_sii_risksurface
Examples
library(ggsolvencyii)
library(ggplot2)
## see details about id and comparewithid
# sii_z_ex3_data[sii_z_ex3_data$description == "SCR", ]
ggplot()+
geom_sii_riskoutline(data = sii_z_ex3_data, mapping = aes(
# comparewithid = comparewithid,
x = time,
y = ratio,
value = value,
id = id,
description = description),
color = "red",
lwd = 0.7
)
##and with comparewithid in aes()
ggplot()+
geom_sii_riskoutline(data = sii_z_ex3_data, mapping = aes(
comparewithid = comparewithid,
x = time,
y = ratio,
value = value,
id = id,
description = description),
color = "red",
lwd = 0.7
)