Function to get the first class of the object x, except if the class "gg" is returned in which case "ggplot" is returned instead if present as one of the classes of the object:
Function to get the first class of the object x, except if the class "gg" is returned in which case "ggplot" is returned instead if present as one of the classes of the object: