Is it possible to conditionally format elements in a custom ggplot2 theme (such as the presence of legend, position of legend or font styling etc) based on the geom selected? For example, if user wants to create a line graph plot then the theme would be read that as a condition being satisfied and move the legend position to the bottom of the graph.
The most similar question I could find was in: Conditionally modify ggplot theme based on presence of facets?
But I am not sure if this approach (and if so, how) could be applied to other components of the graph such as the type of geom. New to R, thanks. Not sure where to go from here.