Does any one have tried set theme_xkcd() globally? I'm getting this error and I dont know how to solve it.
library(ggplot2)
library(xkcd)
#> Loading required package: extrafont
#> Registering fonts with R
library(magrittr)
theme_set(
theme_xkcd()
)
#> Warning: New theme missing the following elements: line, rect,
#> axis.title.x, axis.title.x.top, axis.title.y, axis.title.y.right,
#> axis.text, axis.text.x, axis.text.x.top, axis.text.y, axis.text.y.right,
#> axis.ticks.length, axis.line, axis.line.x, axis.line.y, legend.background,
#> legend.margin, legend.spacing, legend.spacing.x, legend.spacing.y,
#> legend.key.size, legend.key.height, legend.key.width, legend.text,
#> legend.text.align, legend.title, legend.title.align, legend.position,
#> legend.direction, legend.justification, legend.box, legend.box.margin,
#> legend.box.background, legend.box.spacing, panel.border, panel.spacing,
#> panel.spacing.x, panel.spacing.y, panel.grid, panel.ontop, plot.background,
#> plot.title, plot.subtitle, plot.caption, plot.tag, plot.tag.position,
#> plot.margin, strip.placement, strip.text, strip.text.x, strip.text.y,
#> strip.switch.pad.grid, strip.switch.pad.wrap
cars %>%
ggplot(aes(speed, dist)) +
geom_point()
#> Theme element panel.border missing
#> Error in Ops.unit(one, theme$axis.ticks.length): both operands must be units
Created on 2018-08-14 by the reprex package (v0.2.0).