get_embedded_font returns which font is actually embedded by cairo_pdf. cleave converts a delimiter separated string into a vector. inch(x) is equivalent to unit(x, "in"). is_color_invisible tells whether the color is transparent (and hence need not be drawn).

is_color_invisible(col)

inch(inches)

cleave(s, sep = ",", float = FALSE, color = FALSE)

file2grob(file, distort = TRUE)

Arguments

col

Color

inches

Number representing number of inches

s

String to convert

sep

Delimiter (defaults to ",")

float

If TRUE cast to numeric

color

if TRUE convert empty strings to "transparent"

file

Filename of image

distort

Logical value of whether one should preserve the aspect ratio or distort to fit the area it is drawn in

Examples

to_x(90, 1)
#> [1] 6.123234e-17
to_y(180, 0.5)
#> [1] 6.123234e-17
to_t(0, -1)
#> [1] -90
to_r(0.5, 0)
#> [1] 0.5
cleave("0.5,0.2,0.4,0.5", float=TRUE)
#> [1] 0.5 0.2 0.4 0.5
cleave("black,darkred,#050EAA,,", color=TRUE)
#> [1] "black" "darkred" "#050EAA" "transparent" "transparent"
if (require("grid")) { grid.rect(width=inch(1), height=inch(3), gp=gpar(fill="blue")) }
is_color_invisible("transparent")
#> [1] TRUE
is_color_invisible(NA)
#> [1] TRUE
is_color_invisible("blue")
#> [1] FALSE
is_color_invisible("#05AE9C")
#> [1] FALSE