calc_element(element, theme, verbose = FALSE)
Calculate the element properties, by inheriting properties from its parents
t <- theme_grey() calc_element('text', t)List of 9 $ family : chr "" $ face : chr "plain" $ colour : chr "black" $ size : num 11 $ hjust : num 0.5 $ vjust : num 0.5 $ angle : num 0 $ lineheight: num 0.9 $ margin :Classes 'margin', 'unit' atomic [1:4] 0 0 0 0 .. ..- attr(*, "unit")= chr "pt" .. ..- attr(*, "valid.unit")= int 8 - attr(*, "class")= chr [1:2] "element_text" "element"# Compare the "raw" element definition to the element with calculated inheritance t$axis.text.xList of 9 $ family : NULL $ face : NULL $ colour : NULL $ size : NULL $ hjust : NULL $ vjust : num 1 $ angle : NULL $ lineheight: NULL $ margin :Classes 'margin', 'unit' atomic [1:4] 2.2 0 0 0 .. ..- attr(*, "unit")= chr "pt" .. ..- attr(*, "valid.unit")= int 8 - attr(*, "class")= chr [1:2] "element_text" "element"calc_element('axis.text.x', t, verbose = TRUE)axis.text.x --> axis.text axis.text --> text text --> nothing (top level)List of 9 $ family : chr "" $ face : chr "plain" $ colour : chr "grey30" $ size : num 8.8 $ hjust : num 0.5 $ vjust : num 1 $ angle : num 0 $ lineheight: num 0.9 $ margin :Classes 'margin', 'unit' atomic [1:4] 2.2 0 0 0 .. ..- attr(*, "unit")= chr "pt" .. ..- attr(*, "valid.unit")= int 8 - attr(*, "class")= chr [1:2] "element_text" "element"# This reports that axis.text.x inherits from axis.text, # which inherits from text. You can view each of them with: t$axis.text.xList of 9 $ family : NULL $ face : NULL $ colour : NULL $ size : NULL $ hjust : NULL $ vjust : num 1 $ angle : NULL $ lineheight: NULL $ margin :Classes 'margin', 'unit' atomic [1:4] 2.2 0 0 0 .. ..- attr(*, "unit")= chr "pt" .. ..- attr(*, "valid.unit")= int 8 - attr(*, "class")= chr [1:2] "element_text" "element"t$axis.textList of 9 $ family : NULL $ face : NULL $ colour : chr "grey30" $ size :Class 'rel' num 0.8 $ hjust : NULL $ vjust : NULL $ angle : NULL $ lineheight: NULL $ margin : NULL - attr(*, "class")= chr [1:2] "element_text" "element"t$textList of 9 $ family : chr "" $ face : chr "plain" $ colour : chr "black" $ size : num 11 $ hjust : num 0.5 $ vjust : num 0.5 $ angle : num 0 $ lineheight: num 0.9 $ margin :Classes 'margin', 'unit' atomic [1:4] 0 0 0 0 .. ..- attr(*, "unit")= chr "pt" .. ..- attr(*, "valid.unit")= int 8 - attr(*, "class")= chr [1:2] "element_text" "element"