Despite the roxygen2 tag '@import ggplot2' being present in all the functions that use ggplot, 'testthat' seems not to load it properly, resulting in 'ggplot() not found' errors.
The issue became apparent after removing all the explicit 'ggplot2::' prefixes that were previously used to avoid explicitly importing ggplot2 and making it an optional dependency.
Despite the roxygen2 tag '@import ggplot2' being present in all the functions that use ggplot, 'testthat' seems not to load it properly, resulting in 'ggplot() not found' errors.
The issue became apparent after removing all the explicit 'ggplot2::' prefixes that were previously used to avoid explicitly importing ggplot2 and making it an optional dependency.