I'm building a package in RStudio and using %+replace% in my code. During runtime this is no problem. However during build and test (testthat) an error is raised:
R could not find function "%+replace%".
Unlying are the following messages:
no visible global function definition for ‘%+replace%’
Undefined global functions or variables:
I use the %+replace% while creating a new ggplot theme based on theme_bw(). Reprex:
function(base_size = 11,
base_family = "Helvetica",
base_line_size = base_size / 170,
base_rect_size = base_size / 170)
base_size = base_size,
base_family = base_family,
base_line_size = base_line_size
# Set style for chart title.
plot.title = ggplot2::element_text(
size = ggplot2::rel(1.5),
colour = "dodgerblue3",
face = "bold"
complete = FALSE
which is then used in creating plots:
ggplot(iris, eas(x = Sepal.Length, y = Petal.Length, colour = Species)) +
geom_jitter() + my_theme() + labs(title = "IRIS plot with my theme")
I guess I have to prefix %+replace% with a package name but is that true, and if so what should be the package name? TIA.