I have the following:
allPlots <- ggtern::grid.arrange(t1, t2, t3, t4, t5, t6, t7, t8, t9, nrow = 3, ncol = 3)
I want to create a function and pass the variables t1 to t9 programatically instead of manually typing them.
Here is the function:
plotsGrid <- function(...) {
allPlots <- ggtern::grid.arrange(..., nrow = 3, ncol = 3)
return (allPlots)
}
Is there a way to pass arguments to a function programatically? (maybe by creating a sequence from t1 to t9 that references global variables)? Any help is appreciated.