I have the following two graphs I make:
animal_arrange <-
grid.arrange(
dogs_male +
ggtitle("A. Dogs") +
cats_male +
ggtitle("B. Cats") +
elepahnts_male +
ggtitle("C. Elephant") +
ncol = 1
)
animal_arrange <-
grid.arrange(
dogs_female +
ggtitle("A. Dogs") +
cats_female +
ggtitle("B. Cats") +
elepahnts_female +
ggtitle("C. Elephant") +
ncol = 1
)
is there a way to create a tidyverse function to avoid unnecessary lines of codes? I just want the same graph for the data frames that end with "animal"_female and "animal"_male...